mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-04 00:03:25 -04:00
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>
This commit is contained in:
parent
09e2a8b78c
commit
f3de5d857b
1 changed files with 4 additions and 1 deletions
|
@ -406,9 +406,12 @@ static int bcma_hcd_probe(struct bcma_device *core)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
usb_dev->core = core;
|
usb_dev->core = core;
|
||||||
|
|
||||||
if (core->dev.of_node)
|
if (core->dev.of_node) {
|
||||||
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
|
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
|
||||||
GPIOD_OUT_HIGH);
|
GPIOD_OUT_HIGH);
|
||||||
|
if (IS_ERR(usb_dev->gpio_desc))
|
||||||
|
return PTR_ERR(usb_dev->gpio_desc);
|
||||||
|
}
|
||||||
|
|
||||||
switch (core->id.id) {
|
switch (core->id.id) {
|
||||||
case BCMA_CORE_USB20_HOST:
|
case BCMA_CORE_USB20_HOST:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue