From fc875510409c21e430f4c7d950b858170e0b7341 Mon Sep 17 00:00:00 2001 From: Xiongfeng Wang Date: Fri, 22 Aug 2025 18:01:21 +0800 Subject: [PATCH 1/2] hiroce3: Use IS_ERR() to check the return value of kthread_run() 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 --- 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); } -- Gitee From f1c2a768f2cafc37bcacb4028a0a4783c6833f92 Mon Sep 17 00:00:00 2001 From: Xiongfeng Wang Date: Fri, 22 Aug 2025 18:01:22 +0800 Subject: [PATCH 2/2] ACPI / MPAM: Fix wrong IS_ERR() check in _parse_table() 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 --- 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; } -- Gitee