diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-07-19 08:24:42 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-22 12:34:37 -0300 |
commit | 0ea92c50ad0d3c20db5ad4ee71bc6588baf1dfa9 (patch) | |
tree | c145bc061f2a5db0fa17a510427bfe2fad4fe7ea /drivers/staging | |
parent | 4a86bc1008e7202b49ccb59f52d7a6be9311ef7d (diff) | |
download | blackbird-op-linux-0ea92c50ad0d3c20db5ad4ee71bc6588baf1dfa9.tar.gz blackbird-op-linux-0ea92c50ad0d3c20db5ad4ee71bc6588baf1dfa9.zip |
[media] staging: lirc: add missing platform_device_del() on error
Add the missing platform_device_del() before return from
lirc_parallel_init() in the error handling case.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/lirc/lirc_parallel.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/media/lirc/lirc_parallel.c b/drivers/staging/media/lirc/lirc_parallel.c index 3906ac6e686d..878fdea6b111 100644 --- a/drivers/staging/media/lirc/lirc_parallel.c +++ b/drivers/staging/media/lirc/lirc_parallel.c @@ -650,7 +650,7 @@ static int __init lirc_parallel_init(void) if (!pport) { pr_notice("no port at %x found\n", io); result = -ENXIO; - goto exit_device_put; + goto exit_device_del; } ppdevice = parport_register_device(pport, LIRC_DRIVER_NAME, pf, kf, lirc_lirc_irq_handler, 0, @@ -659,7 +659,7 @@ static int __init lirc_parallel_init(void) if (!ppdevice) { pr_notice("parport_register_device() failed\n"); result = -ENXIO; - goto exit_device_put; + goto exit_device_del; } if (parport_claim(ppdevice) != 0) goto skip_init; @@ -678,7 +678,7 @@ static int __init lirc_parallel_init(void) parport_release(pport); parport_unregister_device(ppdevice); result = -EIO; - goto exit_device_put; + goto exit_device_del; } #endif @@ -695,11 +695,13 @@ static int __init lirc_parallel_init(void) pr_notice("register_chrdev() failed\n"); parport_unregister_device(ppdevice); result = -EIO; - goto exit_device_put; + goto exit_device_del; } pr_info("installed using port 0x%04x irq %d\n", io, irq); return 0; +exit_device_del: + platform_device_del(lirc_parallel_dev); exit_device_put: platform_device_put(lirc_parallel_dev); exit_driver_unregister: |