]> git.baikalelectronics.ru Git - kernel.git/commit
staging, media, easycap: Fix mem leak in easycap_usb_probe()
authorJesper Juhl <jj@chaosbits.net>
Sun, 29 Jan 2012 20:55:28 +0000 (21:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2012 17:51:47 +0000 (09:51 -0800)
commit879d9d5373fa55e4271161aec34fb0ba74de42c2
treee8cff87f3eb532fe7705282a00592bbe40cde66f
parentff3fc1aab1fc525331435c4ed1aa28eae165f679
staging, media, easycap: Fix mem leak in easycap_usb_probe()

If allocating 'pdata_urb' fails, the function will return -ENOMEM
without freeing the memory allocated, just a few lines above, for
'purb' and will leak that memory when 'purb' goes out of scope.

This patch resolves the leak by freeing the allocated storage with
usb_free_urb() before the return.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/easycap/easycap_main.c