hdpvr: Fix memory leak in debug
Subsystems (2)
PATCH 1/1 hdpvr: Fix memory leak in debug
cppcheck reported memory leak in device_authorizatio() within hdpvr-core.c.
When the debug option is specified and the code jump to "unlock:" label, print_buf was not freed. Confirm the module succesfully compiled without error.
Signed-off-by Masanari Iida <[email protected]>
--- drivers/media/usb/hdpvr/hdpvr-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/usb/hdpvr/hdpvr-core.c +3 -1
@@ -198,7 +198,6 @@ static int device_authorization(struct hdpvr_device *dev)hex_dump_to_buffer (response,8 ,16 ,1 , print_buf,5 *buf_size+1 ,0 );v4l2_dbg (MSG_INFO , hdpvr_debug, &dev->v4l2_dev," response: %s\n" , print_buf); -kfree (print_buf);#endif msleep (100 );
@@ -214,6 +213,9 @@ static int device_authorization(struct hdpvr_device *dev) retval = ret !=8 ; unlock:mutex_unlock (&dev->usbc_mutex); +#ifdef HDPVR_DEBUG +kfree (print_buf); +#endif return retval; }
Signature · 1 line
1.8.5.2.309.ga25014b