linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varun B Patil <varun.basavaraj.patil@gmail.com>
To: linux-omap@vger.kernel.org
Cc: Varun B Patil <varun.basavaraj.patil@gmail.com>
Subject: [PATCH] omapdce : fix bug in ioctl_codec_process
Date: Sun,  6 Oct 2013 18:38:46 +0530	[thread overview]
Message-ID: <1381064927-3798-2-git-send-email-varun.basavaraj.patil@gmail.com> (raw)
In-Reply-To: <1381064927-3798-1-git-send-email-varun.basavaraj.patil@gmail.com>

Do not send already free'd pointer to rpabort when rpsend fails.

Signed-off-by: Varun B Patil <varun.basavaraj.patil@gmail.com>
---
 drivers/staging/omapdce/dce.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdce/dce.c b/drivers/staging/omapdce/dce.c
index 2a7cbef..1d9b75c 100644
--- a/drivers/staging/omapdce/dce.c
+++ b/drivers/staging/omapdce/dce.c
@@ -1318,15 +1318,17 @@ static int ioctl_codec_process(struct drm_device *dev, void *data,
 
 		ret = rpsend(priv, &arg->token, hdr(req), ptr - (void *)req);
 rpsend_out:
-		kfree(req);
 		if (ret) {
 			/* if input buffer is already locked, unlock it now so we
 			 * don't have a leak:
 			 */
 			if (input_id)
 				codec_unlockbuf(priv, arg->codec_handle, input_id);
-			return rpabort(hdr(req), ret);
+			ret = rpabort(hdr(req), ret);
+			kfree(req);
+			return ret;
 		}
+		kfree(req);
 	}
 
 	/* then wait for reply, which is interruptible */
-- 
1.8.1.2


  reply	other threads:[~2013-10-06 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-06 13:08 [PATCH] omapdce : clear transaction if engine_open rpsend fails Varun B Patil
2013-10-06 13:08 ` Varun B Patil [this message]
2013-10-06 13:08 ` [PATCH] omapdce : fix transaction corruption due to wrong request id Varun B Patil

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=1381064927-3798-2-git-send-email-varun.basavaraj.patil@gmail.com \
    --to=varun.basavaraj.patil@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).