All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Engelmayer <cengelma@gmx.at>
To: mchehab@osg.samsung.com
Cc: crope@iki.fi, benjamin@southpole.se, linux-media@vger.kernel.org,
	Christian Engelmayer <cengelma@gmx.at>
Subject: [PATCH] [media] mn88472: Fix possible leak in mn88472_init()
Date: Sat,  2 May 2015 23:59:29 +0200	[thread overview]
Message-ID: <1430603969-7177-1-git-send-email-cengelma@gmx.at> (raw)

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(-)

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);
 
-- 
1.9.1


             reply	other threads:[~2015-05-02 22:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 21:59 Christian Engelmayer [this message]
2015-05-02 22:06 ` [PATCH] [media] mn88472: Fix possible leak in mn88472_init() Benjamin Larsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430603969-7177-1-git-send-email-cengelma@gmx.at \
    --to=cengelma@gmx.at \
    --cc=benjamin@southpole.se \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.