From: Darren Jenkins Date: Thu, 11 Feb 2010 11:07:53 +0000 (-0300) Subject: V4L/DVB: drivers/media/radio/si470x/radio-si470x-usb.c fix use after free X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=96dd6de3d058a454a5bc4ce2f561a053dd90bfae;p=linux-beck.git V4L/DVB: drivers/media/radio/si470x/radio-si470x-usb.c fix use after free In si470x_usb_driver_disconnect() radio->disconnect_lock is accessed after it is freed. This fixes the problem. Coverity CID: 2530 Signed-off-by: Darren Jenkins Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index a0a79c70dd5b..6f60841828da 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -842,9 +842,11 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) kfree(radio->int_in_buffer); video_unregister_device(radio->videodev); kfree(radio->buffer); + mutex_unlock(&radio->disconnect_lock); kfree(radio); + } else { + mutex_unlock(&radio->disconnect_lock); } - mutex_unlock(&radio->disconnect_lock); }