staging: r8188eu: handle rtw_write8 errors in SwLedOn

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>
This commit is contained in:
Martin Kaiser
2022-10-15 17:11:07 +02:00
committed by Greg Kroah-Hartman
parent 12c6223fc1
commit e5931b7ba5

View 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;
}