mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/media/radio/si470x/radio-si470x-usb.c fix use after free
@ 2010-02-11 11:07 Darren Jenkins
  2010-02-18 19:16 ` Tobias Lorenz
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Jenkins @ 2010-02-11 11:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Tobias Lorenz, Tobias Lorenz, Douglas Schilling Landgraf,
	linux-media, Linux Kernel Mailing List, Kernel Janitors

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>
---
 drivers/media/radio/si470x/radio-si470x-usb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c
index a96e1b9..1588a9d 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);
 }
 
 
-- 
1.6.3.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-18 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-11 11:07 [PATCH] drivers/media/radio/si470x/radio-si470x-usb.c fix use after free Darren Jenkins
2010-02-18 19:16 ` Tobias Lorenz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®