[PATCH] : media : hackrf : memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



     
Due to a missing v4l2_device_get function in the hackrf_probe function, 
the reference count of the v4l2_device object reaches zero inside the 
wrong API function (video_unregister_device) instead of v4l2_device_put. 
This causes a memory leak as the release callback would not get called.


Reported-by: Tuba Yavuz <tuba@xxxxxxxxxxx>
Signed-off-by: Tuba Yavuz <tuba@xxxxxxxxxxx>
---


--- drivers/media/usb/hackrf/hackrf.c.orig	2019-01-26 11:37:18.912210823 -0500
+++ drivers/media/usb/hackrf/hackrf.c	2019-01-27 17:50:41.660736688 -0500
@@ -1524,6 +1524,7 @@ static int hackrf_probe(struct usb_inter
 			"Failed to register as video device (%d)\n", ret);
 		goto err_video_unregister_device_rx;
 	}
+	v4l2_device_get(&dev->v4l2_dev);
 	dev_info(dev->dev, "Registered as %s\n",
 		 video_device_node_name(&dev->tx_vdev));​
 




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux