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

From: Saurabh Sengar
Date: Fri Nov 06 2015 - 11:58:00 EST


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

Signed-off-by: Saurabh Sengar <saurabh.truth@xxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/