aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-02-02 08:22:34 -0500
committerHelge Deller <deller@gmx.de>2017-02-25 16:27:30 -0500
commite28f701b21ee4b4eb716e4717fa2aa78c28a8523 (patch)
treee4ad1fe08defaf2214da3a4f716f9e9d4121096d /drivers
parent09b871ffd4d8ddc005a9480fb69ff1897caaeb1f (diff)
parisc: ccio-dma: Handle return NULL error from ioremap_nocache
Fix error paths and return -ENOMEM instead of '1'. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parisc/ccio-dma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 553ef8a5d588..b0558e2451b5 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -1539,7 +1539,7 @@ static int __init ccio_probe(struct parisc_device *dev)
1539 ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); 1539 ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
1540 if (ioc == NULL) { 1540 if (ioc == NULL) {
1541 printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); 1541 printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
1542 return 1; 1542 return -ENOMEM;
1543 } 1543 }
1544 1544
1545 ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn"; 1545 ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
@@ -1554,6 +1554,10 @@ static int __init ccio_probe(struct parisc_device *dev)
1554 1554
1555 ioc->hw_path = dev->hw_path; 1555 ioc->hw_path = dev->hw_path;
1556 ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096); 1556 ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
1557 if (!ioc->ioc_regs) {
1558 kfree(ioc);
1559 return -ENOMEM;
1560 }
1557 ccio_ioc_init(ioc); 1561 ccio_ioc_init(ioc);
1558 ccio_init_resources(ioc); 1562 ccio_init_resources(ioc);
1559 hppa_dma_ops = &ccio_ops; 1563 hppa_dma_ops = &ccio_ops;