diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2016-12-12 16:41:05 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-12 18:55:06 -0800 |
commit | 3da82065f1e59fd280742cd792cbf2fb2052958f (patch) | |
tree | aa8b49a1c95a08cd0699fa882e047a23ba5e82bc /drivers/pcmcia/m32r_pcc.c | |
parent | c795cf4f1865659b40a286a9997e64f4c15bbc9b (diff) | |
download | lwn-3da82065f1e59fd280742cd792cbf2fb2052958f.tar.gz lwn-3da82065f1e59fd280742cd792cbf2fb2052958f.zip |
drivers/pcmcia/m32r_pcc.c: check return from add_pcc_socket
If request_irq() fails it passes the error to the caller. The caller
now checks it and jumps to the common error path on failure.
Link: http://lkml.kernel.org/r/1474237304-897-3-git-send-email-sudipm.mukherjee@gmail.com
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pcmcia/m32r_pcc.c')
-rw-r--r-- | drivers/pcmcia/m32r_pcc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 56bf38804e93..e50bbf826188 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c @@ -696,10 +696,16 @@ static int __init init_m32r_pcc(void) pcc_sockets = 0; - add_pcc_socket(M32R_PCC0_BASE, PCC0_IRQ, M32R_PCC0_MAPBASE, 0x1000); + ret = add_pcc_socket(M32R_PCC0_BASE, PCC0_IRQ, M32R_PCC0_MAPBASE, + 0x1000); + if (ret) + goto unreg_dev; #ifdef CONFIG_M32RPCC_SLOT2 - add_pcc_socket(M32R_PCC1_BASE, PCC1_IRQ, M32R_PCC1_MAPBASE, 0x2000); + ret = add_pcc_socket(M32R_PCC1_BASE, PCC1_IRQ, M32R_PCC1_MAPBASE, + 0x2000); + if (ret) + goto unreg_dev; #endif if (pcc_sockets == 0) { |