summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-08-28 01:01:57 +0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-08-28 01:01:57 +0300
commit85bcb84b39a55fcb134c712f6a22c370cd3ce494 (patch)
tree3d9879a2a54d4ed8e934e07691153f423f105f3f /linux/drivers
parent15c59158bf156027a01c96945aa2f52bc8bd92b3 (diff)
downloadmediapointer-dvb-s2-85bcb84b39a55fcb134c712f6a22c370cd3ce494.tar.gz
mediapointer-dvb-s2-85bcb84b39a55fcb134c712f6a22c370cd3ce494.tar.bz2
vivi_release(): fix use-after-free
From: Adrian Bunk <bunk@kernel.org> video_device_release() does kfree(), which made the following printk() doing a use-after-free. printk() first and release then. Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/vivi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index d345aed08..f6a12b184 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -1029,13 +1029,13 @@ static int vivi_release(void)
dev = list_entry(list, struct vivi_dev, vivi_devlist);
if (-1 != dev->vfd->minor) {
- video_unregister_device(dev->vfd);
- printk(KERN_INFO "%s: /dev/video%d unregistered.\n",
+ printk(KERN_INFO "%s: unregistering /dev/video%d\n",
VIVI_MODULE_NAME, dev->vfd->minor);
+ video_unregister_device(dev->vfd);
} else {
- video_device_release(dev->vfd);
- printk(KERN_INFO "%s: /dev/video%d released.\n",
+ printk(KERN_INFO "%s: releasing /dev/video%d\n",
VIVI_MODULE_NAME, dev->vfd->minor);
+ video_device_release(dev->vfd);
}
kfree(dev);