platform/x86: mlx-platform: Fix an ERR_PTR vs NULL issue
Subsystems (2)
PATCH 1/1 platform/x86: mlx-platform: Fix an ERR_PTR vs NULL issue
devm_ioport_map() returns NULL on error but we accidentally check for error pointers instead.
drivers/platform/x86/mlx-platform.c +2 -2
@@ -522,8 +522,8 @@ static int __init mlxplat_init(void) mlxplat_mlxcpld_regmap_ctx.base =devm_ioport_map (&mlxplat_dev->dev, mlxplat_lpc_resources[1 ].start,1 ); -if (IS_ERR (mlxplat_mlxcpld_regmap_ctx.base)) { - err =PTR_ERR (mlxplat_mlxcpld_regmap_ctx.base); +if (!mlxplat_mlxcpld_regmap_ctx.base) { + err = -ENOMEM ; goto fail_platform_mux_register; }
Quoted 11 lines
-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, February 06, 2018 2:46 PM
To: Vadim Pasternak <[email protected]>
Cc: Darren Hart <[email protected]>; Andy Shevchenko <[email protected]>; [email protected]; kernel- [email protected]
Subject: [PATCH] platform/x86: mlx-platform: Fix anERR_PTRvs NULL issue
Quoted 6 lines
devm_ioport_map()returns NULL on error but we accidentally check for error pointers instead.Fixes c6acad68eb2d ("platform/mellanox: mlxreg-hotplug: Modify to use aregmap interface")
Signed-off-by Dan Carpenter <[email protected]>
Quoted 18 lines
drivers/platform/x86/mlx- renamed from drivers/platform/x86/mlx-platform.c +0
-0
platform.c
indexdfecba4407ac..27de29961f5e100644drivers/platform/x86/mlx-platform.c +2
-2@@ -522,8 +522,8 @@ static int __init mlxplat_init(void) mlxplat_mlxcpld_regmap_ctx.base =devm_ioport_map (&mlxplat_dev- >dev, mlxplat_lpc_resources[1 ].start,1 ); -if (IS_ERR (mlxplat_mlxcpld_regmap_ctx.base)) { - err =PTR_ERR (mlxplat_mlxcpld_regmap_ctx.base); +if (!mlxplat_mlxcpld_regmap_ctx.base) { + err = -ENOMEM ; goto fail_platform_mux_register; }
Darren Hart
AppliedQuoted 11 lines · Vadim Pasternak
Quoted 11 lines
-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, February 06, 2018 2:46 PM
To: Vadim Pasternak <[email protected]>
Cc: Darren Hart <[email protected]>; Andy Shevchenko <[email protected]>; [email protected]; kernel- [email protected]
Subject: [PATCH] platform/x86: mlx-platform: Fix anERR_PTRvs NULL issue
Quoted 8 lines
Quoted 6 lines
devm_ioport_map()returns NULL on error but we accidentally check for error pointers instead.Fixes c6acad68eb2d ("platform/mellanox: mlxreg-hotplug: Modify to use aregmap interface")
Signed-off-by Dan Carpenter <[email protected]>Acked-by Vadim Pasternak <[email protected]>
Queued up for today's PR for 4.16. Thanks.
Signature · 2 lines
Darren Hart VMware Open Source Technology Center