Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1228891 > unrolled thread

[PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable

Started byNicolas Iooss <nicolas.iooss_linux@m4x.org>
First post2015-09-20 16:20 +0200
Last post2015-09-20 16:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable Nicolas Iooss <nicolas.iooss_linux@m4x.org> - 2015-09-20 16:20 +0200

#1228891 — [PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable

FromNicolas Iooss <nicolas.iooss_linux@m4x.org>
Date2015-09-20 16:20 +0200
Subject[PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable
Message-ID<qaNDb-2fl-5@gated-at.bofh.it>
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 <nicolas.iooss_linux@m4x.org>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web