[PATCH 02/10] staging: r8188eu: handle rtw_write8 errors in SwLedOn

From: Martin Kaiser
Date: Sat Oct 15 2022 - 11:11:48 EST


Check the status returned by rtw_write8. Update bLedOn only if we could
update the REG_LEDCFG2 register.

Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
---
drivers/staging/r8188eu/core/rtw_led.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index 5b214488571b..4f1cad890cae 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -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;
}

--
2.30.2