
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