Skip to content

Commit

Permalink
[media] si2165: Fix possible leak in si2165_upload_firmware()
Browse files Browse the repository at this point in the history
In case of an error function si2165_upload_firmware() releases the already
requested firmware in the exit path. However, there is one deviation where
the function directly returns. Use the correct cleanup so that the firmware
memory gets freed correctly. Detected by Coverity CID 1269120.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Luis de Bethencourt <luis.bg@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Christian Engelmayer authored and Mauro Carvalho Chehab committed Apr 8, 2015
1 parent 51b5b3d commit ec73b9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb-frontends/si2165.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static int si2165_upload_firmware(struct si2165_state *state)
/* reset crc */
ret = si2165_writereg8(state, 0x0379, 0x01);
if (ret)
return ret;
goto error;

ret = si2165_upload_firmware_block(state, data, len,
&offset, block_count);
Expand Down

0 comments on commit ec73b9f

Please sign in to comment.