From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755460AbbITOOc (ORCPT ); Sun, 20 Sep 2015 10:14:32 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:52507 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755231AbbITOOY (ORCPT ); Sun, 20 Sep 2015 10:14:24 -0400 From: Nicolas Iooss To: Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , Mauro Carvalho Chehab , kernel@stlinux.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Iooss Subject: [PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable Date: Sun, 20 Sep 2015 16:14:07 +0200 Message-Id: <1442758447-1474-2-git-send-email-nicolas.iooss_linux@m4x.org> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1442758447-1474-1-git-send-email-nicolas.iooss_linux@m4x.org> References: <1442758447-1474-1-git-send-email-nicolas.iooss_linux@m4x.org> X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sun Sep 20 16:14:22 2015 +0200 (CEST)) X-Spam-Flag: No, tests=bogofilter, spamicity=0.000000, queueID=B02831408EFB9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When load_c8sectpfe_fw_step1() tests whether the return value of request_firmware_nowait(), stored in variable err, indicates an error, it then returns the value hold by uninitialized variable ret, which seems incorrect. Fix this by forwarding the error returned by request_firmware_nowait() to the caller of load_c8sectpfe_fw_step1(). Signed-off-by: Nicolas Iooss --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index a424339b18bc..c25a1172bcf5 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -1192,7 +1192,6 @@ err: static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei) { - int ret; int err; dev_info(fei->dev, "Loading firmware: %s\n", FIRMWARE_MEMDMA); @@ -1207,7 +1206,7 @@ static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei) if (err) { dev_err(fei->dev, "request_firmware_nowait err: %d.\n", err); complete_all(&fei->fw_ack); - return ret; + return err; } return 0; -- 2.5.2