Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f40a2916 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 6773c1c2
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1345,6 +1345,8 @@ static void module_cleanup(void)
{
{
	int i, j;
	int i, j;


	pci_unregister_driver(&ivtv_pci_driver);

	for (i = 0; i < ivtv_cards_active; i++) {
	for (i = 0; i < ivtv_cards_active; i++) {
		if (ivtv_cards[i] == NULL)
		if (ivtv_cards[i] == NULL)
			continue;
			continue;
@@ -1353,7 +1355,6 @@ static void module_cleanup(void)
		}
		}
		kfree(ivtv_cards[i]);
		kfree(ivtv_cards[i]);
	}
	}
	pci_unregister_driver(&ivtv_pci_driver);
}
}


/* Note: These symbols are exported because they are used by the ivtv-fb
/* Note: These symbols are exported because they are used by the ivtv-fb