rtl818x_pci: fix pci probe returns success when it fails
authorAndrea Merello <andrea.merello@gmail.com>
Mon, 30 Jun 2014 16:19:40 +0000 (18:19 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 1 Jul 2014 18:26:27 +0000 (14:26 -0400)
commitc1084e026b4fe73fcc54f82d6a6bd26d9372d583
tree4bab27c11b5136065d4ba6ba9e353fc147e9b5a6
parentf4cf628781f802ecf5efa0ceb5e81a2f80dea5b8
rtl818x_pci: fix pci probe returns success when it fails

There are several exit path from the PCI probe function.
Some of them, that are taken in case of errors, forget to set the "err"
variable, that is returned by the probe function.
This can lead to the kernel thinking the probe function succeeds while it
didn't, and this in turn causes extra calls to the "remove" function.

This patch fix this problem by ensuring "err" variable is assigned to a proper
non-zero value in each exit path.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtl818x/rtl8180/dev.c