summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/vivi.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-12-20 11:03:53 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-20 11:03:53 -0200
commitd0ba028476be663d9871ec33a547431bb98b052b (patch)
tree430fa420b827979717163ba4d7f50c9217b545f2 /linux/drivers/media/video/vivi.c
parent690b7a5300af11cf3c1109147733b8acabc2317d (diff)
downloadmediapointer-dvb-s2-d0ba028476be663d9871ec33a547431bb98b052b.tar.gz
mediapointer-dvb-s2-d0ba028476be663d9871ec33a547431bb98b052b.tar.bz2
Vivi: fix use after free in list_for_each()
From: Akinobu Mita <akinobu.mita@gmail.com> Freeing data including list_head in list_for_each() is not safe. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/vivi.c')
-rw-r--r--linux/drivers/media/video/vivi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index 751128368..fb69c6dbb 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -1447,7 +1447,9 @@ static void __exit vivi_exit(void)
struct vivi_dev *h;
struct list_head *list;
- list_for_each(list,&vivi_devlist) {
+ while (!list_empty(&vivi_devlist)) {
+ list = vivi_devlist.next;
+ list_del(list);
h = list_entry(list, struct vivi_dev, vivi_devlist);
kfree (h);
}