aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc/eisa.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-01-18 03:11:31 -0500
committerHelge Deller <deller@gmx.de>2017-02-25 16:21:21 -0500
commitaf640d17ecee1f82a949b580cc4a3e8f29c377b9 (patch)
treec2426ff1e8ea21131e3ed627df62d1ded2097a11 /drivers/parisc/eisa.c
parent99cde44edfa06b5f910c1704cb15d36310a56545 (diff)
parisc: eisa: Fix resource leaks in error paths
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/parisc/eisa.c')
-rw-r--r--drivers/parisc/eisa.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index 59edee911f7d..7e2f6d5a6aaf 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -334,7 +334,7 @@ static int __init eisa_probe(struct parisc_device *dev)
334 result = request_irq(dev->irq, eisa_irq, IRQF_SHARED, "EISA", &eisa_dev); 334 result = request_irq(dev->irq, eisa_irq, IRQF_SHARED, "EISA", &eisa_dev);
335 if (result) { 335 if (result) {
336 printk(KERN_ERR "EISA: request_irq failed!\n"); 336 printk(KERN_ERR "EISA: request_irq failed!\n");
337 return result; 337 goto error_release;
338 } 338 }
339 339
340 /* Reserve IRQ2 */ 340 /* Reserve IRQ2 */
@@ -358,6 +358,11 @@ static int __init eisa_probe(struct parisc_device *dev)
358 } 358 }
359 } 359 }
360 eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH); 360 eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);
361 if (!eisa_eeprom_addr) {
362 result = -ENOMEM;
363 printk(KERN_ERR "EISA: ioremap_nocache failed!\n");
364 goto error_free_irq;
365 }
361 result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, 366 result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,
362 &eisa_dev.hba.lmmio_space); 367 &eisa_dev.hba.lmmio_space);
363 init_eisa_pic(); 368 init_eisa_pic();
@@ -372,11 +377,20 @@ static int __init eisa_probe(struct parisc_device *dev)
372 eisa_dev.root.dma_mask = 0xffffffff; /* wild guess */ 377 eisa_dev.root.dma_mask = 0xffffffff; /* wild guess */
373 if (eisa_root_register (&eisa_dev.root)) { 378 if (eisa_root_register (&eisa_dev.root)) {
374 printk(KERN_ERR "EISA: Failed to register EISA root\n"); 379 printk(KERN_ERR "EISA: Failed to register EISA root\n");
375 return -1; 380 result = -ENOMEM;
381 goto error_iounmap;
376 } 382 }
377 } 383 }
378 384
379 return 0; 385 return 0;
386
387error_iounmap:
388 iounmap(eisa_eeprom_addr);
389error_free_irq:
390 free_irq(dev->irq, &eisa_dev);
391error_release:
392 release_resource(&eisa_dev.hba.io_space);
393 return result;
380} 394}
381 395
382static const struct parisc_device_id eisa_tbl[] = { 396static const struct parisc_device_id eisa_tbl[] = {