提交 e28f701b 编写于 作者: A Arvind Yadav 提交者: Helge Deller

parisc: ccio-dma: Handle return NULL error from ioremap_nocache

Fix error paths and return -ENOMEM instead of '1'.
Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: NHelge Deller <deller@gmx.de>
上级 09b871ff
...@@ -1539,7 +1539,7 @@ static int __init ccio_probe(struct parisc_device *dev) ...@@ -1539,7 +1539,7 @@ static int __init ccio_probe(struct parisc_device *dev)
ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
if (ioc == NULL) { if (ioc == NULL) {
printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
return 1; return -ENOMEM;
} }
ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn"; ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
...@@ -1554,6 +1554,10 @@ static int __init ccio_probe(struct parisc_device *dev) ...@@ -1554,6 +1554,10 @@ static int __init ccio_probe(struct parisc_device *dev)
ioc->hw_path = dev->hw_path; ioc->hw_path = dev->hw_path;
ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096); ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
if (!ioc->ioc_regs) {
kfree(ioc);
return -ENOMEM;
}
ccio_ioc_init(ioc); ccio_ioc_init(ioc);
ccio_init_resources(ioc); ccio_init_resources(ioc);
hppa_dma_ops = &ccio_ops; hppa_dma_ops = &ccio_ops;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册