[PATCH] arm64/mpam: fix the problem that the ret variable is not initialized

From: wenzhiwei11 <wenzhiwei@kylinos.cn> kylin inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4AHUL?from=project-issue CVE: NA --------------------------------------------------- initialize the value "ret" in "schemata_list_init()" Signed-off-by: 温志伟 <wenzhiwei@kylinos.cn> --- arch/arm64/kernel/mpam/mpam_ctrlmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/mpam/mpam_ctrlmon.c b/arch/arm64/kernel/mpam/mpam_ctrlmon.c index a4a298a455e0..9759eb223dac 100644 --- a/arch/arm64/kernel/mpam/mpam_ctrlmon.c +++ b/arch/arm64/kernel/mpam/mpam_ctrlmon.c @@ -131,7 +131,7 @@ static int add_schema(enum resctrl_conf_type t, struct resctrl_resource *r) int schemata_list_init(void) { - int ret; + int ret = 0; struct mpam_resctrl_res *res; struct resctrl_resource *r; -- 2.30.0

Reviewed-by: Wang ShaoBo <bobo.shaobowang@huawei.com> 在 2021/10/13 17:45, wenzhiwei 写道:
From: wenzhiwei11 <wenzhiwei@kylinos.cn>
kylin inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4AHUL?from=project-issue CVE: NA
---------------------------------------------------
initialize the value "ret" in "schemata_list_init()"
Signed-off-by: 温志伟 <wenzhiwei@kylinos.cn> --- arch/arm64/kernel/mpam/mpam_ctrlmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/mpam/mpam_ctrlmon.c b/arch/arm64/kernel/mpam/mpam_ctrlmon.c index a4a298a455e0..9759eb223dac 100644 --- a/arch/arm64/kernel/mpam/mpam_ctrlmon.c +++ b/arch/arm64/kernel/mpam/mpam_ctrlmon.c @@ -131,7 +131,7 @@ static int add_schema(enum resctrl_conf_type t, struct resctrl_resource *r)
int schemata_list_init(void) { - int ret; + int ret = 0; struct mpam_resctrl_res *res; struct resctrl_resource *r;

Looks good to me, Reviewed-by: Xie XiuQi <xiexiuqi@huawei.com> On 2021/10/13 17:56, Wangshaobo (bobo) wrote:
Reviewed-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
在 2021/10/13 17:45, wenzhiwei 写道:
From: wenzhiwei11 <wenzhiwei@kylinos.cn>
kylin inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4AHUL?from=project-issue CVE: NA
---------------------------------------------------
initialize the value "ret" in "schemata_list_init()"
Signed-off-by: 温志伟 <wenzhiwei@kylinos.cn> --- arch/arm64/kernel/mpam/mpam_ctrlmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/mpam/mpam_ctrlmon.c b/arch/arm64/kernel/mpam/mpam_ctrlmon.c index a4a298a455e0..9759eb223dac 100644 --- a/arch/arm64/kernel/mpam/mpam_ctrlmon.c +++ b/arch/arm64/kernel/mpam/mpam_ctrlmon.c @@ -131,7 +131,7 @@ static int add_schema(enum resctrl_conf_type t, struct resctrl_resource *r) int schemata_list_init(void) { - int ret; + int ret = 0; struct mpam_resctrl_res *res; struct resctrl_resource *r; .
participants (3)
-
Wangshaobo (bobo)
-
wenzhiwei
-
Xie XiuQi