Commit 8a0f5b6f authored by Dan Carpenter's avatar Dan Carpenter Committed by Darren Hart (VMware)

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: c6acad68 ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarVadim Pasternak <vadimp@melanox.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 661405bd
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment