USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe()
Subsystems (3)
PATCH 1/1 USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/usb/host/ohci-sm501.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-sm501.c +4 -3
@@ -157,9 +157,10 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)* the call to usb_hcd_setup_local_mem() below does just that. */ -if (usb_hcd_setup_local_mem (hcd, mem->start, - mem->start - mem->parent->start, -resource_size (mem)) <0 ) + retval =usb_hcd_setup_local_mem (hcd, mem->start, + mem->start - mem->parent->start, +resource_size (mem)); +if (retval <0 ) goto err5; retval =usb_add_hcd (hcd, irq,IRQF_SHARED );if (retval)
Quoted 17 lines · Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 7d9e6f5aebe8 ("usb: host: ohci-sm501: init genalloc for local memory")Signed-off-by Wei Yongjun <[email protected]>--- drivers/usb/host/ohci-sm501.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/usb/host/ohci-sm501.c +0
-0@@ -157,9 +157,10 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)* the call to usb_hcd_setup_local_mem() below does just that. */
drivers/usb/host/ohci-sm501.c static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev) · line 166
Quoted 10 lines
drivers/usb/host/ohci-sm501.c +4
-3-if (usb_hcd_setup_local_mem (hcd, mem->start, - mem->start - mem->parent->start, -resource_size (mem)) <0 ) + retval =usb_hcd_setup_local_mem (hcd, mem->start, + mem->start - mem->parent->start, +resource_size (mem)); +if (retval <0 ) goto err5; retval =usb_add_hcd (hcd, irq,IRQF_SHARED );if (retval)
Thanks for noticing and fixing this.
Alan Stern
Walter Harms
Acked-by Alan Sternwhile you are here ...
maybe you can give labels like err5 some meaningful names ?
re,
wh
________________________________________
Von: [email protected] <[email protected]> im Auftrag von Alan Stern <[email protected]>
Gesendet: Mittwoch, 6. Mai 2020 16:12:08
An: Wei Yongjun
Cc: Greg Kroah-Hartman; Laurentiu Tudor; [email protected]; [email protected]
Betreff: Re: [PATCH -next] USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe()
Quoted 17 lines · Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 7d9e6f5aebe8 ("usb: host: ohci-sm501: init genalloc for local memory")Signed-off-by Wei Yongjun <[email protected]>--- drivers/usb/host/ohci-sm501.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/usb/host/ohci-sm501.c +0
-0@@ -157,9 +157,10 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)* the call to usb_hcd_setup_local_mem() below does just that. */
drivers/usb/host/ohci-sm501.c static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev) · line 166
Quoted 10 lines
drivers/usb/host/ohci-sm501.c +4
-3-if (usb_hcd_setup_local_mem (hcd, mem->start, - mem->start - mem->parent->start, -resource_size (mem)) <0 ) + retval =usb_hcd_setup_local_mem (hcd, mem->start, + mem->start - mem->parent->start, +resource_size (mem)); +if (retval <0 ) goto err5; retval =usb_add_hcd (hcd, irq,IRQF_SHARED );if (retval)
Thanks for noticing and fixing this.
Alan Stern