staging: r8188eu: handle rtw_write8 errors in SwLedOn
authorMartin Kaiser <martin@kaiser.cx>
Sat, 15 Oct 2022 15:11:07 +0000 (17:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Oct 2022 15:41:41 +0000 (17:41 +0200)
Check the status returned by rtw_write8. 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-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_led.c

index 5b214488571bb85025a9210c24a1a85d91f5fabf..4f1cad890cae79402e13a76ddecd9ac11090dfbe 100644 (file)
@@ -34,7 +34,9 @@ static void SwLedOn(struct adapter *padapter, struct led_priv *pLed)
        if (padapter->bDriverStopped)
                return;
 
-       rtw_write8(padapter, REG_LEDCFG2, BIT(5)); /*  SW control led0 on. */
+       if (rtw_write8(padapter, REG_LEDCFG2, BIT(5)) != _SUCCESS)
+               return;
+
        pLed->bLedOn = true;
 }