mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 09:43:59 +08:00
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: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
b331daa03c
commit
72f678c301
@ -1363,7 +1363,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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user