From: Pan Bian <bianpan201603@163.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>, linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Pan Bian <bianpan2016@163.com>
Subject: [PATCH 1/1] media: pci: meye: set error code on failures
Date: Sun, 4 Dec 2016 13:39:17 +0800 [thread overview]
Message-ID: <1480829957-4793-1-git-send-email-bianpan201603@163.com> (raw)
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
next reply other threads:[~2016-12-04 5:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-04 5:39 Pan Bian [this message]
2016-12-04 5:40 [PATCH 1/1] media: pci: meye: set error code on failures Pan Bian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480829957-4793-1-git-send-email-bianpan201603@163.com \
--to=bianpan201603@163.com \
--cc=bianpan2016@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).