From: Zihao Tang <tangzihao1@xxxxxxxxxxxxx> Fix the following smatch warnings: drivers/usb/host/ohci-hcd.c:1318 ohci_hcd_mod_init() warn: ignoring unreachable code. platform_driver_register(&TMIO_OHCI_DRIVER) is the last platform_driver_register() call in ohci_hcd_mod_init(), so if it failed, there's no need to unregister it, but just goto error_tmio. So remove the unreachable platform_driver_unregister(&TMIO_OHCI_DRIVER). No functionality change. Reported-by: kernel test robot <lkp@xxxxxxxxx> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Zihao Tang <tangzihao1@xxxxxxxxxxxxx> Signed-off-by: Jay Fang <f.fangjian@xxxxxxxxxx> --- drivers/usb/host/ohci-hcd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 1f5e693..2d09ef2 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1319,7 +1319,6 @@ static int __init ohci_hcd_mod_init(void) /* Error path */ #ifdef TMIO_OHCI_DRIVER - platform_driver_unregister(&TMIO_OHCI_DRIVER); error_tmio: #endif #ifdef SM501_OHCI_DRIVER -- 2.7.4