diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-10-09 19:13:03 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-10 12:33:59 +0200 |
commit | b3c669be90ddfa70409ab6335dadf3ef46473f9a (patch) | |
tree | e0806990935d0da1cb361a51b69bdfdf24ea9a43 /drivers/staging | |
parent | bb97bc286171f58f3286c2d1da876c7a62708ea6 (diff) | |
download | linux-b3c669be90ddfa70409ab6335dadf3ef46473f9a.tar.gz linux-b3c669be90ddfa70409ab6335dadf3ef46473f9a.tar.bz2 linux-b3c669be90ddfa70409ab6335dadf3ef46473f9a.zip |
staging: wfx: wfx_init_common() returns NULL on error
Smatch complains:
bus_spi.c:228 wfx_spi_probe() warn: 'bus->core' could be an error pointer
bus_sdio.c:221 wfx_sdio_probe() warn: 'bus->core' could be an error pointer
bus->core contains the result of wfx_init_common(). With this patch,
wfx_init_common() returns a valid pointer or NULL.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201009171307.864608-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/wfx/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index a8dc2c033410..e7bc1988124a 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -309,7 +309,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, wdev->pdata.gpio_wakeup = devm_gpiod_get_optional(dev, "wakeup", GPIOD_OUT_LOW); if (IS_ERR(wdev->pdata.gpio_wakeup)) - return ERR_CAST(wdev->pdata.gpio_wakeup); + return NULL; if (wdev->pdata.gpio_wakeup) gpiod_set_consumer_name(wdev->pdata.gpio_wakeup, "wfx wakeup"); |