From: Wei Yongjun Date: Thu, 25 Apr 2013 07:18:02 +0000 (+0800) Subject: spi-topcliff-pch: missing platform_driver_unregister() on error in pch_spi_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0113f22ee49ff1972de55632dda44eb9299e625d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git spi-topcliff-pch: missing platform_driver_unregister() on error in pch_spi_init() Add the missing platform_driver_unregister() before return from pch_spi_init() in the error handling case. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index f756481b0fea..c8b672e07ba0 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1789,8 +1789,10 @@ static int __init pch_spi_init(void) return ret; ret = pci_register_driver(&pch_spi_pcidev_driver); - if (ret) + if (ret) { + platform_driver_unregister(&pch_spi_pd_driver); return ret; + } return 0; }