Skip to content

Commit b919e07

Browse files
Wei Yongjungregkh
authored andcommitted
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. Fixes: 7d9e6f5 ("usb: host: ohci-sm501: init genalloc for local memory") Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c856b4b commit b919e07

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/usb/host/ohci-sm501.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
157157
* the call to usb_hcd_setup_local_mem() below does just that.
158158
*/
159159

160-
if (usb_hcd_setup_local_mem(hcd, mem->start,
161-
mem->start - mem->parent->start,
162-
resource_size(mem)) < 0)
160+
retval = usb_hcd_setup_local_mem(hcd, mem->start,
161+
mem->start - mem->parent->start,
162+
resource_size(mem));
163+
if (retval < 0)
163164
goto err5;
164165
retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
165166
if (retval)

0 commit comments

Comments
 (0)