diff mbox

[media] mn88472: Fix possible leak in mn88472_init()

Message ID 1430603969-7177-1-git-send-email-cengelma@gmx.at (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Engelmayer May 2, 2015, 9:59 p.m. UTC
Commit 307e95c92257 ("[media] mn88472: implement firmware parity check")
introduced the usage of exit paths that do not free the already allocated
firmware data in case the parity handling fails. Go through the correct
exit paths. Detected by Coverity CID 1295989.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
Compile tested only. Applies against linux-next.
---
 drivers/staging/media/mn88472/mn88472.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Benjamin Larsson May 2, 2015, 10:06 p.m. UTC | #1
On 05/02/2015 11:59 PM, Christian Engelmayer wrote:
> Commit 307e95c92257 ("[media] mn88472: implement firmware parity check")
> introduced the usage of exit paths that do not free the already allocated
> firmware data in case the parity handling fails. Go through the correct
> exit paths. Detected by Coverity CID 1295989.
>
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>

ACK

MvH
Benjamin Larsson
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
index a4cfcf57c99c..6863c431c648 100644
--- a/drivers/staging/media/mn88472/mn88472.c
+++ b/drivers/staging/media/mn88472/mn88472.c
@@ -344,12 +344,12 @@  static int mn88472_init(struct dvb_frontend *fe)
 	if (ret) {
 		dev_err(&client->dev,
 				"parity reg read failed=%d\n", ret);
-		goto err;
+		goto firmware_release;
 	}
 	if (tmp & 0x10) {
 		dev_err(&client->dev,
 				"firmware parity check failed=0x%x\n", tmp);
-		goto err;
+		goto firmware_release;
 	}
 	dev_err(&client->dev, "firmware parity check succeeded=0x%x\n", tmp);