forked from luck/tmp_suning_uos_patched
pcmcia: i82365.c: check request_irq return value
Add a check for the request_irq() return value. Signed-off-by: Leonardo Potenza <lpotenza@inwind.it> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
b3363997a6
commit
2df697036b
|
@ -1263,7 +1263,7 @@ static int __init init_i82365(void)
|
||||||
|
|
||||||
ret = driver_register(&i82365_driver);
|
ret = driver_register(&i82365_driver);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto err_out;
|
||||||
|
|
||||||
i82365_device = platform_device_alloc("i82365", 0);
|
i82365_device = platform_device_alloc("i82365", 0);
|
||||||
if (i82365_device) {
|
if (i82365_device) {
|
||||||
|
@ -1273,10 +1273,8 @@ static int __init init_i82365(void)
|
||||||
} else
|
} else
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
|
||||||
if (ret) {
|
if (ret)
|
||||||
driver_unregister(&i82365_driver);
|
goto err_driver_unregister;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
printk(KERN_INFO "Intel ISA PCIC probe: ");
|
printk(KERN_INFO "Intel ISA PCIC probe: ");
|
||||||
sockets = 0;
|
sockets = 0;
|
||||||
|
@ -1285,16 +1283,17 @@ static int __init init_i82365(void)
|
||||||
|
|
||||||
if (sockets == 0) {
|
if (sockets == 0) {
|
||||||
printk("not found.\n");
|
printk("not found.\n");
|
||||||
platform_device_unregister(i82365_device);
|
ret = -ENODEV;
|
||||||
release_region(i365_base, 2);
|
goto err_dev_unregister;
|
||||||
driver_unregister(&i82365_driver);
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up interrupt handler(s) */
|
/* Set up interrupt handler(s) */
|
||||||
if (grab_irq != 0)
|
if (grab_irq != 0)
|
||||||
request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
|
ret = request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
goto err_socket_release;
|
||||||
|
|
||||||
/* register sockets with the pcmcia core */
|
/* register sockets with the pcmcia core */
|
||||||
for (i = 0; i < sockets; i++) {
|
for (i = 0; i < sockets; i++) {
|
||||||
socket[i].socket.dev.parent = &i82365_device->dev;
|
socket[i].socket.dev.parent = &i82365_device->dev;
|
||||||
|
@ -1324,7 +1323,23 @@ static int __init init_i82365(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
err_socket_release:
|
||||||
|
for (i = 0; i < sockets; i++) {
|
||||||
|
/* Turn off all interrupt sources! */
|
||||||
|
i365_set(i, I365_CSCINT, 0);
|
||||||
|
release_region(socket[i].ioaddr, 2);
|
||||||
|
}
|
||||||
|
err_dev_unregister:
|
||||||
|
platform_device_unregister(i82365_device);
|
||||||
|
release_region(i365_base, 2);
|
||||||
|
#ifdef CONFIG_PNP
|
||||||
|
if (i82365_pnpdev)
|
||||||
|
pnp_disable_dev(i82365_pnpdev);
|
||||||
|
#endif
|
||||||
|
err_driver_unregister:
|
||||||
|
driver_unregister(&i82365_driver);
|
||||||
|
err_out:
|
||||||
|
return ret;
|
||||||
} /* init_i82365 */
|
} /* init_i82365 */
|
||||||
|
|
||||||
static void __exit exit_i82365(void)
|
static void __exit exit_i82365(void)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user