* [PATCH 1/1] media: pci: meye: set error code on failures
@ 2016-12-04 5:39 Pan Bian
0 siblings, 0 replies; 2+ messages in thread
From: Pan Bian @ 2016-12-04 5:39 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media; +Cc: linux-kernel, Pan Bian
From: Pan Bian <bianpan2016@163.com>
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>
---
drivers/media/pci/meye/meye.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index ba887e8..115e141 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1669,6 +1669,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");
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 1/1] media: pci: meye: set error code on failures
@ 2016-12-04 5:40 Pan Bian
0 siblings, 0 replies; 2+ messages in thread
From: Pan Bian @ 2016-12-04 5:40 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media; +Cc: linux-kernel, Pan Bian
From: Pan Bian <bianpan2016@163.com>
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>
---
drivers/media/pci/meye/meye.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index ba887e8..115e141 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1669,6 +1669,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");
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-04 5:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-04 5:39 [PATCH 1/1] media: pci: meye: set error code on failures Pan Bian
2016-12-04 5:40 Pan Bian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).