lkml.org 
[lkml]   [2015]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable
Date
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


\
 
 \ /
  Last update: 2015-09-20 16:21    [W:0.025 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site