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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:11:51 +0000 (20:11 -0700)
commit8a478b1a7fd69e567e07ed4da23d3b3572fa728c
treefb5754fe9d204097773fba8b0aa63bc8f4d436aa
parentacdad30d78a68bce2208131523c00d341bb3d914
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/sja1000/peak_pci.c