linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFT] [media] em28xx: Fix use-after-free in v4l2_fh_init
@ 2017-11-09  5:49 Arvind Yadav
  2017-11-09 13:07 ` Andrey Konovalov
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-11-09  5:49 UTC (permalink / raw)
  To: mchehab, andreyknvl, kcc, dvyukov; +Cc: linux-kernel, linux-media

Here, em28xx_free_v4l2 is release "v4l2->dev->v4l2"
Which is allready release by em28xx_v4l2_init.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
This bug report by Andrey Konovalov "net/media/em28xx: use-after-free in v4l2_fh_init"

 drivers/media/usb/em28xx/em28xx-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 8d253a5..f1ee53f 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -2785,8 +2785,8 @@ static int em28xx_v4l2_init(struct em28xx *dev)
 	v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
 	v4l2_device_unregister(&v4l2->v4l2_dev);
 err:
-	dev->v4l2 = NULL;
 	kref_put(&v4l2->ref, em28xx_free_v4l2);
+	dev->v4l2 = NULL;
 	mutex_unlock(&dev->lock);
 	return ret;
 }
-- 
1.9.1

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

end of thread, other threads:[~2017-11-09 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09  5:49 [RFT] [media] em28xx: Fix use-after-free in v4l2_fh_init Arvind Yadav
2017-11-09 13:07 ` Andrey Konovalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).