Skip to content

Commit b3c669b

Browse files
jerome-pouillergregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Jérôme Pouiller <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bb97bc2 commit b3c669b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/wfx/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ struct wfx_dev *wfx_init_common(struct device *dev,
309309
wdev->pdata.gpio_wakeup = devm_gpiod_get_optional(dev, "wakeup",
310310
GPIOD_OUT_LOW);
311311
if (IS_ERR(wdev->pdata.gpio_wakeup))
312-
return ERR_CAST(wdev->pdata.gpio_wakeup);
312+
return NULL;
313313
if (wdev->pdata.gpio_wakeup)
314314
gpiod_set_consumer_name(wdev->pdata.gpio_wakeup, "wfx wakeup");
315315

0 commit comments

Comments
 (0)