can: peak_pci: prevent use after free at netdev removal
authorStephane Grosjean <s.grosjean@peak-system.com>
Tue, 20 May 2014 09:38:56 +0000 (11:38 +0200)
committerJiri Slaby <jslaby@suse.cz>
Wed, 2 Jul 2014 10:06:01 +0000 (12:06 +0200)
commite98ee26dfbe339f4ee37add68e47ed6fa0603fd9
tree1b572cfed56c65e04305a0edbb69af070860c8ce
parent22e7597be4cf5a51a710d63f62852afea8f2a5ff
can: peak_pci: prevent use after free at netdev removal

commit 0b5a958cf4df3a5cd578b861471e62138f55c85e upstream.

As remarked by Christopher R. Baker in his post at

http://marc.info/?l=linux-can&m=139707295706465&w=2

there's a possibility for an use after free condition at device removal.

This simplified patch introduces an additional variable to prevent the issue.
Thanks for catching this.

Reported-by: Christopher R. Baker <cbaker@rec.ri.cmu.edu>
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/net/can/sja1000/peak_pci.c