Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752514AbcLDFjZ (ORCPT ); Sun, 4 Dec 2016 00:39:25 -0500 Received: from m50-135.163.com ([123.125.50.135]:57276 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbcLDFjY (ORCPT ); Sun, 4 Dec 2016 00:39:24 -0500 X-Greylist: delayed 949 seconds by postgrey-1.27 at vger.kernel.org; Sun, 04 Dec 2016 00:39:24 EST From: Pan Bian To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] media: pci: meye: set error code on failures Date: Sun, 4 Dec 2016 13:39:17 +0800 Message-Id: <1480829957-4793-1-git-send-email-bianpan201603@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: D9GowAAH9vIErENY3jQHIQ--.4101S3 X-Coremail-Antispam: 1Uf129KBjvdXoWruF17tr1kXw18Jw1fJF4xWFg_yoWfuFXEga 1UZr97Zr4kKrn3Kr17tryfZryqk390g34rJr4kta9Ik3W3Aw1kA3Z0vF1DJF1q9w4IvFyD KrykXF15ur1UXjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYqZX5UUUUU== X-Originating-IP: [114.243.30.33] X-CM-SenderInfo: held01tdqsiiqwqtqiywtou0bp/xtbBlwY291SISlMYbAAAsh Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 904 Lines: 28 From: Pan Bian 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 --- 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