提交 c4277e9e 编写于 作者: A Alexey Khoroshilov 提交者: Greg Kroah-Hartman

uio/uio_pci_generic: don't return zero on failure path in probe()

If uio_register_device() fails in probe(), it breaks off initialization,
deallocates all resources, but returns zero.

The patch adds proper error code propagation.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5de61e7a
......@@ -91,7 +91,8 @@ static int probe(struct pci_dev *pdev,
gdev->info.handler = irqhandler;
gdev->pdev = pdev;
if (uio_register_device(&pdev->dev, &gdev->info))
err = uio_register_device(&pdev->dev, &gdev->info);
if (err)
goto err_register;
pci_set_drvdata(pdev, gdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册