Skip to content

Commit

Permalink
platform/x86: mlx-platform: Fix an ERR_PTR vs NULL issue
Browse files Browse the repository at this point in the history
devm_ioport_map() returns NULL on error but we accidentally check for
error pointers instead.

Fixes: c6acad6 ("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>
  • Loading branch information
Dan Carpenter authored and Darren Hart (VMware) committed Feb 6, 2018
1 parent 661405b commit 8a0f5b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/platform/x86/mlx-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8a0f5b6

Please sign in to comment.