]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] c8sectpfe: fix ininitialized error return on firmware load failure
authorColin Ian King <colin.king@canonical.com>
Tue, 15 Sep 2015 11:42:27 +0000 (08:42 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 3 Oct 2015 14:14:35 +0000 (11:14 -0300)
static analysis with cppcheck detected the following error:

[drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1210]:
  (error) Uninitialized variable: ret

ret is never initialised, so garbage is being returned. Instead
return the error return from the call of request_firmware_nowait

Signed-off-by: Colin Ian King <colin.king@canonical.com>
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c

index e358b9163a687e0334927046b67562fcd335e4ac..373222e8c3fbc48edb9dad6406a34dfbf68fb1d1 100644 (file)
@@ -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;