staging: r8188eu: fix status updates in SwLedOff
authorMartin Kaiser <martin@kaiser.cx>
Sat, 15 Oct 2022 15:11:08 +0000 (17:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Oct 2022 15:41:41 +0000 (17:41 +0200)
Update bLedOn only if we could update the REG_LEDCFG2 register.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221015151115.232095-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_led.c

index 4f1cad890cae79402e13a76ddecd9ac11090dfbe..38433296d327fc332a6993900eb8ee5bd2d5f90d 100644 (file)
@@ -43,10 +43,11 @@ static void SwLedOn(struct adapter *padapter, struct led_priv *pLed)
 static void SwLedOff(struct adapter *padapter, struct led_priv *pLed)
 {
        if (padapter->bDriverStopped)
-               goto exit;
+               return;
+
+       if (rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)) != _SUCCESS)
+               return;
 
-       rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3));
-exit:
        pLed->bLedOn = false;
 }