diff options
author | Pan Bian <bianpan2016@163.com> | 2016-12-04 00:40:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-02-03 05:01:30 -0500 |
commit | 2ce899423c150c38e2b1590a83a2e22f8c77b60a (patch) | |
tree | 26c9877992f86eca4190f7beeb7dbfe8db6b60e7 /drivers/media/pci/meye | |
parent | d54a90c4c19307986effa50a93e47d1df7a132a6 (diff) |
[media] media: pci: meye: set error code on failures
The value of return variable ret is 0 on some error paths, for example,
when pci_resource_start() returns a NULL pointer. 0 means no error in
this context, which is contrary to the fact. This patch fixes the bug.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189011
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/meye')
-rw-r--r-- | drivers/media/pci/meye/meye.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 6274a9c5be47..9c4a024745de 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c | |||
@@ -1659,6 +1659,7 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) | |||
1659 | goto outenabledev; | 1659 | goto outenabledev; |
1660 | } | 1660 | } |
1661 | 1661 | ||
1662 | ret = -EIO; | ||
1662 | mchip_adr = pci_resource_start(meye.mchip_dev,0); | 1663 | mchip_adr = pci_resource_start(meye.mchip_dev,0); |
1663 | if (!mchip_adr) { | 1664 | if (!mchip_adr) { |
1664 | v4l2_err(v4l2_dev, "meye: mchip has no device base address\n"); | 1665 | v4l2_err(v4l2_dev, "meye: mchip has no device base address\n"); |