提交 72f678c3 编写于 作者: A Akinobu Mita 提交者: Mauro Carvalho Chehab

V4L/DVB (4994): Vivi: fix use after free in list_for_each()

Freeing data including list_head in list_for_each() is not safe.
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 b331daa0
...@@ -1363,7 +1363,9 @@ static void __exit vivi_exit(void) ...@@ -1363,7 +1363,9 @@ static void __exit vivi_exit(void)
struct vivi_dev *h; struct vivi_dev *h;
struct list_head *list; 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); h = list_entry(list, struct vivi_dev, vivi_devlist);
kfree (h); kfree (h);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部