提交 57fe1479 编写于 作者: A Alexey Khoroshilov 提交者: David S. Miller

smsc911x: Add check for ioremap_nocache() return code

There is no check for return code of smsc911x_drv_probe()
in smsc911x_drv_probe(). The patch adds one.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8f44c9a4
......@@ -2467,6 +2467,10 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
pdata = netdev_priv(dev);
dev->irq = irq;
pdata->ioaddr = ioremap_nocache(res->start, res_size);
if (!pdata->ioaddr) {
retval = -ENOMEM;
goto out_ioremap_fail;
}
pdata->dev = dev;
pdata->msg_enable = ((1 << debug) - 1);
......@@ -2572,6 +2576,7 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
smsc911x_free_resources(pdev);
out_request_resources_fail:
iounmap(pdata->ioaddr);
out_ioremap_fail:
free_netdev(dev);
out_release_io_1:
release_mem_region(res->start, resource_size(res));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册