From patchwork Tue Nov 22 20:52:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9442157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99DF760235 for ; Tue, 22 Nov 2016 20:53:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B8E61FF15 for ; Tue, 22 Nov 2016 20:53:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 805AE1FFAE; Tue, 22 Nov 2016 20:53:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 352471FF15 for ; Tue, 22 Nov 2016 20:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756811AbcKVUxA (ORCPT ); Tue, 22 Nov 2016 15:53:00 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:53968 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752140AbcKVUw7 (ORCPT ); Tue, 22 Nov 2016 15:52:59 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0MbXro-1cPrXB3fqW-00InU5; Tue, 22 Nov 2016 21:52:33 +0100 From: Arnd Bergmann To: "Lad, Prabhakar" , Mauro Carvalho Chehab Cc: Arnd Bergmann , Hans Verkuil , Markus Elfring , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] DaVinci-VPFE-Capture: fix error handling Date: Tue, 22 Nov 2016 21:52:17 +0100 Message-Id: <20161122205231.799066-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:Lu2M2aZ9Qb628IduoLcTBvpdOn3bQ5Vv8yYH2Ayoo86tUTCAkTc rn73Nm0vKb9uYDAcjGEiV3X+2F1xoDxKUXkPhZRUHOL1hDyJD3S4XA9OdMRX50Ax9QUFNAt XBlfXep1t6idHNucRoToQ8Szi3h3TGIJpptmv47jC/TWm2YGe2IrM+LSigzkJ64D4CdcDHb SmDjtTbKGFS3H8g0lceFg== X-UI-Out-Filterresults: notjunk:1; V01:K0:DhkEZ+Dj93s=:S/Hj7EWrhIaW0IqVFtVjdq NlpRO9urzTwSnhStiZEjZ1pQaVACvNjbG4plmAHRX35rwY9IT+UjNfmOMwNk9olLgoahqFJZR oOpmbRDOqmEHbL0hqKvcySc+sJ7y6668mvG326zPbBCnq54ScnS5PkZeS8K5al18kqef7YY4A I3HXzA1U7OUCQDCSzkUfQWB1HLXKP1kD0EW88kocq2KdczgZ7D3ipe2ogCauIyEBHkwD/oyzf SViXCRvY4104C2gvjcNl0t1BnL1AaWztAvy7sZU8YK6jeVe3z5hGlk9p8ptoeUO8AfxLDcwGe Bth/0Spvf4RAJy4c37u4XBDzY+lgkNYmHA4wByf0hk6UF7r355wAtA4hzWI8X3EBOgBUI6uTv teJsJOCMBrpmj53RJaljlkZbvWe6ZlZM5ZufNN1bpG78RUmUHhx1hCF1QNR9tve3wUhqfJQma vZQCZl1rvC9LWOVP80HCkCjPEbTM3Pg4EfY74HkoH9kGWZPcdBtUBVVxxtNUBi+30m7OmsCAw unhWf7J5jVNGUCnudBQdSYGgGvA82XGu/wo8QvJaj5STcYY8yVWKI02wdzX2TuHTAuRSqruHg a4BTlTjQ3CyWcQYxoX7RU8y5RIb+NmbVGOWdqntYr4YbT3lNsdcLZMCAQPhWS/1Ub1yTek+j+ sfH+z9UWfUpPLdZRQl4POvFLF0+2kOlEyjxaIxDagHlVEuIojNuLMHO2nsu00MDDIiVQ= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A recent cleanup had the right idea to remove the initialization of the error variable, but missed the actual benefit of that, which is that we get warnings if there is a bug in it. Now we get a warning about a bug that was introduced by this cleanup: drivers/media/platform/davinci/vpfe_capture.c: In function 'vpfe_probe': drivers/media/platform/davinci/vpfe_capture.c:1992:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds the missing initialization that the warning is about, and another one that was preexisting and that we did not get a warning for. That second bug has existed since the driver was first added. Fixes: efb74461f5a6 ("[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_probe()") Fixes: 7da8a6cb3e5b ("V4L/DVB (12248): v4l: vpfe capture bridge driver for DM355 and DM6446") Signed-off-by: Arnd Bergmann --- drivers/media/platform/davinci/vpfe_capture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 6c41782b3ba0..ee1cd79739c8 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1847,8 +1847,10 @@ static int vpfe_probe(struct platform_device *pdev) /* Allocate memory for ccdc configuration */ ccdc_cfg = kmalloc(sizeof(*ccdc_cfg), GFP_KERNEL); - if (!ccdc_cfg) + if (!ccdc_cfg) { + ret = -ENOMEM; goto probe_free_dev_mem; + } mutex_lock(&ccdc_lock); @@ -1964,6 +1966,7 @@ static int vpfe_probe(struct platform_device *pdev) v4l2_info(&vpfe_dev->v4l2_dev, "v4l2 sub device %s register fails\n", sdinfo->name); + ret = -ENXIO; goto probe_sd_out; } }