浏览代码

V4L/DVB (5417): First unregister the driver, and then free the memory.

ivtv_remove which is called by pci_unregister_driver was still using
memory that was already freed. Ouch.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Hans Verkuil 18 年之前
父节点
当前提交
f40a291684
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/media/video/ivtv/ivtv-driver.c

+ 2 - 1
drivers/media/video/ivtv/ivtv-driver.c

@@ -1345,6 +1345,8 @@ static void module_cleanup(void)
 {
 	int i, j;
 
+	pci_unregister_driver(&ivtv_pci_driver);
+
 	for (i = 0; i < ivtv_cards_active; i++) {
 		if (ivtv_cards[i] == NULL)
 			continue;
@@ -1353,7 +1355,6 @@ static void module_cleanup(void)
 		}
 		kfree(ivtv_cards[i]);
 	}
-	pci_unregister_driver(&ivtv_pci_driver);
 }
 
 /* Note: These symbols are exported because they are used by the ivtv-fb