Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sudip Mukherjee and committed by
Linus Torvalds
3da82065 c795cf4f

+8 -2
+8 -2
drivers/pcmcia/m32r_pcc.c
··· 696 696 697 697 pcc_sockets = 0; 698 698 699 - add_pcc_socket(M32R_PCC0_BASE, PCC0_IRQ, M32R_PCC0_MAPBASE, 0x1000); 699 + ret = add_pcc_socket(M32R_PCC0_BASE, PCC0_IRQ, M32R_PCC0_MAPBASE, 700 + 0x1000); 701 + if (ret) 702 + goto unreg_dev; 700 703 701 704 #ifdef CONFIG_M32RPCC_SLOT2 702 - add_pcc_socket(M32R_PCC1_BASE, PCC1_IRQ, M32R_PCC1_MAPBASE, 0x2000); 705 + ret = add_pcc_socket(M32R_PCC1_BASE, PCC1_IRQ, M32R_PCC1_MAPBASE, 706 + 0x2000); 707 + if (ret) 708 + goto unreg_dev; 703 709 #endif 704 710 705 711 if (pcc_sockets == 0) {