Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1228891
| From | Nicolas Iooss <nicolas.iooss_linux@m4x.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] [media] c8sectpfe: forward err instead of returning an uninitialized variable |
| Date | 2015-09-20 16:20 +0200 |
| Message-ID | <qaNDb-2fl-5@gated-at.bofh.it> (permalink) |
| References | <qaNDb-2fl-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[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
csiph-web