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 <darrenrjenkins@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Darren Jenkins 2010-02-11 08:07:53 -03:00 committed by Mauro Carvalho Chehab
parent 8ef4c21130
commit 96dd6de3d0

View File

@ -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);
}