From d5364fa8ca72c1f58b72e545214aa03bb3c52184 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 11 Mar 2007 00:50:51 +0100 Subject: First unregister the driver, and then free the memory. From: Hans Verkuil ivtv_remove which is called by pci_unregister_driver was still using memory that was already freed. Ouch. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/ivtv/ivtv-driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/drivers/media/video/ivtv/ivtv-driver.c b/linux/drivers/media/video/ivtv/ivtv-driver.c index be35fa43c..3da98f9c4 100644 --- a/linux/drivers/media/video/ivtv/ivtv-driver.c +++ b/linux/drivers/media/video/ivtv/ivtv-driver.c @@ -1349,6 +1349,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; @@ -1357,7 +1359,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 -- cgit v1.2.3