diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-02-06 15:45:36 +0300 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2018-02-06 18:42:38 +0300 |
commit | 8a0f5b6f33275eb0251e0e1b0716744f9d95415f (patch) | |
tree | 842b74e9b4d9bfa7f326f4270d2ce8c11df649c3 /drivers/platform | |
parent | 661405bd817b209ac9bd4812c63d90873a7f2993 (diff) | |
download | linux-8a0f5b6f33275eb0251e0e1b0716744f9d95415f.tar.xz |
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.
Fixes: c6acad68eb2d ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Vadim Pasternak <vadimp@melanox.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/mlx-platform.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index dfecba4407ac..27de29961f5e 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -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; } |