]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
usb: ohci-da8xx: ensure error return on variable error is set
authorColin Ian King <colin.king@canonical.com>
Tue, 7 Jan 2020 12:39:01 +0000 (12:39 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
commit497f5fa8ec07ef64a0e97e15d45adefacee2d43b
tree4f85ef91b36f96c9d1cc490a9a55766e99517673
parent2ccec3f912c678abc242bcf60e84732fd550085a
usb: ohci-da8xx: ensure error return on variable error is set

BugLink: https://bugs.launchpad.net/bugs/1862227
commit ba9b40810bb43e6bf73b395012b98633c03f7f59 upstream.

Currently when an error occurs when calling devm_gpiod_get_optional or
calling gpiod_to_irq it causes an uninitialized error return in variable
'error' to be returned.  Fix this by ensuring the error variable is set
from da8xx_ohci->oc_gpio and oc_irq.

Thanks to Dan Carpenter for spotting the uninitialized error in the
gpiod_to_irq failure case.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: d193abf1c913 ("usb: ohci-da8xx: add vbus and overcurrent gpios")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200107123901.101190-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/host/ohci-da8xx.c