diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-09-24 07:48:13 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-24 15:05:25 -0400 |
commit | 65f7422288cd19c4a9202c4ac7a9cca673b9b2ea (patch) | |
tree | 384d5224632b37741f2d7200ac478e45cd2ac317 | |
parent | 58cbbee2391ce3876e6eee80a4f2a7f025859c52 (diff) |
x86/platform/mellanox: Fix return value check in mlxplat_init()
In case of error, the function platform_device_register_simple()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check must therefor be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/platform/mellanox/mlx-platform.c | 4 |
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) | |||
200 | mlxplat_lpc_resources, | 200 | mlxplat_lpc_resources, |
201 | ARRAY_SIZE(mlxplat_lpc_resources)); | 201 | ARRAY_SIZE(mlxplat_lpc_resources)); |
202 | 202 | ||
203 | if (!mlxplat_dev) | 203 | if (IS_ERR(mlxplat_dev)) |
204 | return -ENOMEM; | 204 | return PTR_ERR(mlxplat_dev); |
205 | 205 | ||
206 | priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv), | 206 | priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv), |
207 | GFP_KERNEL); | 207 | GFP_KERNEL); |