patch "usb: ohci-da8xx: ensure error return on variable error is set" added to usb-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: ohci-da8xx: ensure error return on variable error is set
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From ba9b40810bb43e6bf73b395012b98633c03f7f59 Mon Sep 17 00:00:00 2001
From: Colin Ian King <[email protected]>
Date: Tue, 7 Jan 2020 12:39:01 +0000
Subject: usb: ohci-da8xx: ensure error return on variable error is set
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")
--- drivers/usb/host/ohci-da8xx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-da8xx.c +6 -2
@@ -415,13 +415,17 @@ static int ohci_da8xx_probe(struct platform_device *pdev) } da8xx_ohci->oc_gpio =devm_gpiod_get_optional (dev,"oc" ,GPIOD_IN ); -if (IS_ERR (da8xx_ohci->oc_gpio)) +if (IS_ERR (da8xx_ohci->oc_gpio)) { + error =PTR_ERR (da8xx_ohci->oc_gpio); goto err; + }if (da8xx_ohci->oc_gpio) { oc_irq =gpiod_to_irq (da8xx_ohci->oc_gpio); -if (oc_irq <0 ) +if (oc_irq <0 ) { + error = oc_irq; goto err; + } error = devm_request_threaded_irq(dev, oc_irq, NULL, ohci_da8xx_oc_thread, IRQF_TRIGGER_RISING |
Signature · 1 line
2.24.1