can: peak_usb: fix cleanup sequence order in case of error during init
authorStephane Grosjean <s.grosjean@peak-system.com>
Fri, 28 Nov 2014 12:49:10 +0000 (13:49 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 6 Dec 2014 18:11:18 +0000 (19:11 +0100)
commitaf35d0f1cce7a990286e2b94c260a2c2d2a0e4b0
treec4ffdebf2e27f251c90540877c251d0454e583ca
parentdc50ddcd4c58a5a0226038307d6ef884bec9f8c2
can: peak_usb: fix cleanup sequence order in case of error during init

This patch sets the correct reverse sequence order to the instructions
set to run, when any failure occurs during the initialization steps.
It also adds the missing unregistration call of the can device if the
failure appears after having been registered.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb_core.c