summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/bcma-hcd.c
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-10-16 10:35:32 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-04 15:50:38 +0100
commitf3de5d857bb2362b00e2a8d4bc886cd49dcb66db (patch)
treefeaca8302148b97eb9c15199ecceebba8b10923d /drivers/usb/host/bcma-hcd.c
parentusb: ohci-nxp: fix use of integer as pointer (diff)
downloadlinux-f3de5d857bb2362b00e2a8d4bc886cd49dcb66db.tar.xz
linux-f3de5d857bb2362b00e2a8d4bc886cd49dcb66db.zip
USB: bcma: Add a check for devm_gpiod_get
bcma_hcd_probe misses a check for devm_gpiod_get and may miss the error. Add a check for it and return the error if a failure occurs. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20191016083531.5734-1-hslester96@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/bcma-hcd.c')
-rw-r--r--drivers/usb/host/bcma-hcd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c
index 2400a826397a..652fa29beb27 100644
--- a/drivers/usb/host/bcma-hcd.c
+++ b/drivers/usb/host/bcma-hcd.c
@@ -406,9 +406,12 @@ static int bcma_hcd_probe(struct bcma_device *core)
return -ENOMEM;
usb_dev->core = core;
- if (core->dev.of_node)
+ if (core->dev.of_node) {
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
GPIOD_OUT_HIGH);
+ if (IS_ERR(usb_dev->gpio_desc))
+ return PTR_ERR(usb_dev->gpio_desc);
+ }
switch (core->id.id) {
case BCMA_CORE_USB20_HOST: