summaryrefslogtreecommitdiffstats
path: root/drivers/uio/uio_pci_generic.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2014-12-05 22:28:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-12 14:04:12 +0100
commitc4277e9ea70431aea0fecebb8bb9a3fbc27d074e (patch)
tree95f44b60792c6b0fd74f451c722dcf5f0cbf9971 /drivers/uio/uio_pci_generic.c
parentstable_kernel_rules: reorganize and update submission options (diff)
downloadlinux-c4277e9ea70431aea0fecebb8bb9a3fbc27d074e.tar.xz
linux-c4277e9ea70431aea0fecebb8bb9a3fbc27d074e.zip
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: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio/uio_pci_generic.c')
-rw-r--r--drivers/uio/uio_pci_generic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
index 077ae12269ce..d0b508b68f3c 100644
--- a/drivers/uio/uio_pci_generic.c
+++ b/drivers/uio/uio_pci_generic.c
@@ -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);