mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Saurabh Sengar <saurabh.truth@gmail.com>
To: crope@iki.fi, mchehab@osg.samsung.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Saurabh Sengar <saurabh.truth@gmail.com>
Subject: [PATCH] [media] hackrf: moving pointer reference before kfree
Date: Fri,  6 Nov 2015 22:27:39 +0530	[thread overview]
Message-ID: <1446829059-10196-1-git-send-email-saurabh.truth@gmail.com> (raw)

accessing a pointer after free could possible lead to segmentation
fault, hence correcting it

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
 drivers/media/usb/hackrf/hackrf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
index e05bfec..faf3670 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -1528,9 +1528,9 @@ err_v4l2_ctrl_handler_free_tx:
 err_v4l2_ctrl_handler_free_rx:
 	v4l2_ctrl_handler_free(&dev->rx_ctrl_handler);
 err_kfree:
+	dev_dbg(dev->dev, "failed=%d\n", ret);
 	kfree(dev);
 err:
-	dev_dbg(dev->dev, "failed=%d\n", ret);
 	return ret;
 }
 
-- 
1.9.1


                 reply	other threads:[~2015-11-06 16:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1446829059-10196-1-git-send-email-saurabh.truth@gmail.com \
    --to=saurabh.truth@gmail.com \
    --cc=crope@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome