[PATCH OLK-6.6 0/2] Fix static check warning reported by coccinelle

Xiongfeng Wang (2): hiroce3: Use IS_ERR() to check the return value of kthread_run() ACPI / MPAM: Fix wrong IS_ERR() check in _parse_table() drivers/acpi/arm64/mpam.c | 4 ++-- drivers/infiniband/hw/hiroce3/dfx/roce_dfx_cap.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.20.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17655 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/QX3... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/17655 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/QX3...

Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICU97Y ---------------------------------------------------- The return value of kthread_run() is error pointer, we should use IS_ERR() to check. Fixes: 5bc8dbb5fdf5 ("infiniband/hw/hiroce3: Add Huawei Intelligent Network Card RDMA Driver") Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> --- drivers/infiniband/hw/hiroce3/dfx/roce_dfx_cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hiroce3/dfx/roce_dfx_cap.c b/drivers/infiniband/hw/hiroce3/dfx/roce_dfx_cap.c index cdc75962f03f..3a494263f356 100644 --- a/drivers/infiniband/hw/hiroce3/dfx/roce_dfx_cap.c +++ b/drivers/infiniband/hw/hiroce3/dfx/roce_dfx_cap.c @@ -157,7 +157,7 @@ static int roce3_create_thread(struct sdk_thread_info *thread_info) { thread_info->thread_obj = kthread_run(roce3_linux_thread_func, thread_info, thread_info->name); - if (!thread_info->thread_obj) { + if (IS_ERR(thread_info->thread_obj)) { pr_err("[ROCE, ERR] %s: Failed to create thread\n", __func__); return (-EFAULT); } -- 2.20.1

Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICU97Y ---------------------------------------------------- For error branch of platform_device_alloc(), NULL pointer is returned. We can't use IS_ERR() to check. Fixes: 705058d8b37a ("ACPI / MPAM: Parse the MPAM table") Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> --- drivers/acpi/arm64/mpam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/arm64/mpam.c b/drivers/acpi/arm64/mpam.c index de866e711be2..d34e47fa4558 100644 --- a/drivers/acpi/arm64/mpam.c +++ b/drivers/acpi/arm64/mpam.c @@ -306,8 +306,8 @@ static int __init _parse_table(struct acpi_table_header *table) memset(props, 0, sizeof(props)); pdev = platform_device_alloc("mpam_msc", tbl_msc->identifier); - if (IS_ERR(pdev)) { - err = PTR_ERR(pdev); + if (!pdev) { + err = -ENOMEM; break; } -- 2.20.1
participants (2)
-
patchwork bot
-
Xiongfeng Wang