From: Pan Bian Date: Sun, 4 Dec 2016 05:40:06 +0000 (-0200) Subject: [media] media: pci: meye: set error code on failures X-Git-Tag: v4.11-rc1~132^2~70 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=2ce899423c150c38e2b1590a83a2e22f8c77b60a;p=linux.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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) goto outenabledev; } + ret = -EIO; mchip_adr = pci_resource_start(meye.mchip_dev,0); if (!mchip_adr) { v4l2_err(v4l2_dev, "meye: mchip has no device base address\n");