staging: ks7010: fix error paths in ks7010_sdio_remove function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 23 Apr 2018 13:44:45 +0000 (15:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:47:23 +0000 (15:47 +0200)
commit0cc053ddd47c217abb500bb65ffdadd12d878700
tree2eaea1741e16a4d5d9b533aed4964a2443803f49
parent31d7b1b142a17764ab9f21e37c02163b518d571b
staging: ks7010: fix error paths in ks7010_sdio_remove function

This commit reviews and fixes error paths in ks7010_sdio_remove
driver function. It change logic to handle error directly
after priv dereference to avoid one level indentation. It also
removes a temporal netdev variable which wasn't being used in all
of the function calls. Also if send_stop_request call fails it
was making a direct 'return' instead of doing a properly cleaning.
Because of this a new 'err_free_card' label has been added.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c