]> err.no Git - linux-2.6/commitdiff
V4L/DVB (5417): First unregister the driver, and then free the memory.
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 10 Mar 2007 23:50:51 +0000 (20:50 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:44:33 +0000 (15:44 -0300)
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>
drivers/media/video/ivtv/ivtv-driver.c

index 7058aa25ac9c5c9ce030333b7533f27f789edc9b..d00811a820f767d531e5c42401083aa0c2029aad 100644 (file)
@@ -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