caif: spi: missing platform_driver_unregister() on error in cfspi_init_module()

Submitted by Wei Yongjun on April 25, 2013, 7:15 a.m.

Details

Message ID CAPgLHd8BY8bbBS39Y5HP=qMo7p3OGGcQ9LD8ptiXvwees2QjzQ@mail.gmail.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Wei Yongjun April 25, 2013, 7:15 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing platform_driver_unregister() before return
from cfspi_init_module() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/caif/caif_spi.c | 1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller April 25, 2013, 7:52 a.m.
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Thu, 25 Apr 2013 15:15:23 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing platform_driver_unregister() before return
> from cfspi_init_module() in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied, thanks.

The label was even already there to accomodate this.:-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 2fb279a..155db68 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -863,6 +863,7 @@  static int __init cfspi_init_module(void)
 	driver_remove_file(&cfspi_spi_driver.driver,
 			   &driver_attr_up_head_align);
  err_create_up_head_align:
+	platform_driver_unregister(&cfspi_spi_driver);
  err_dev_register:
 	return result;
 }