Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1264158 > unrolled thread

[PATCH] [media] hackrf: moving pointer reference before kfree

Started bySaurabh Sengar <saurabh.truth@gmail.com>
First post2015-11-06 18:00 +0100
Last post2015-11-06 18:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] hackrf: moving pointer reference before kfree Saurabh Sengar <saurabh.truth@gmail.com> - 2015-11-06 18:00 +0100

#1264158 — [PATCH] [media] hackrf: moving pointer reference before kfree

FromSaurabh Sengar <saurabh.truth@gmail.com>
Date2015-11-06 18:00 +0100
Subject[PATCH] [media] hackrf: moving pointer reference before kfree
Message-ID<qrSwN-71N-3@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web