summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/platform/mellanox/mlx-platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/platform/mellanox/mlx-platform.c b/arch/x86/platform/mellanox/mlx-platform.c
index e1dc1526b5f8..7dcfcca97399 100644
--- a/arch/x86/platform/mellanox/mlx-platform.c
+++ b/arch/x86/platform/mellanox/mlx-platform.c
@@ -200,8 +200,8 @@ static int __init mlxplat_init(void)
mlxplat_lpc_resources,
ARRAY_SIZE(mlxplat_lpc_resources));
- if (!mlxplat_dev)
- return -ENOMEM;
+ if (IS_ERR(mlxplat_dev))
+ return PTR_ERR(mlxplat_dev);
priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv),
GFP_KERNEL);