diff mbox

libertas sdio: claim device before calling sdio_disable_func()

Message ID 1384811108-28807-1-git-send-email-khoroshilov@ispras.ru (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Alexey Khoroshilov Nov. 18, 2013, 9:45 p.m. UTC
There is a failure path in if_sdio_power_on(), where
sdio_disable_func() is called without claiming the device.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/net/wireless/libertas/if_sdio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 991238afd1b6..19c4477eb4c6 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -907,8 +907,8 @@  static int if_sdio_power_on(struct if_sdio_card *card)
 	sdio_release_host(func);
 	ret = if_sdio_prog_firmware(card);
 	if (ret) {
-		sdio_disable_func(func);
-		return ret;
+		sdio_claim_host(func);
+		goto disable;
 	}
 
 	return 0;