platform/mellanox: mlxreg-lc: fix error code in mlxreg_lc_create_static_devices()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Nov 2021 07:43:46 +0000 (10:43 +0300)
committerHans de Goede <hdegoede@redhat.com>
Tue, 16 Nov 2021 09:19:46 +0000 (10:19 +0100)
commit287273a80be5d45d59d1742557cab69cabf0ef3c
treede42e73a592759d4f9bd8a81a9eae511e2f2260d
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
platform/mellanox: mlxreg-lc: fix error code in mlxreg_lc_create_static_devices()

This code should be using PTR_ERR() instead of IS_ERR().  And because
it's using the wrong "dev->client" pointer, the IS_ERR() check will be
false, meaning the function returns success.

Fixes: 62f9529b8d5c ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20211110074346.GB5176@kili
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/mellanox/mlxreg-lc.c