From: Martin Kaiser <martin@xxxxxxxxx> [ Upstream commit 647085006beb2cc41bef27a24f249f4dec3c1e15 ] The SwLedOff function calls rtw_read8 which in turn calls usb_read. bSurpriseRemoved is checked in usb_read. We don't have to check it again in SwLedOff. Tested-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx> # Edimax N150 Signed-off-by: Martin Kaiser <martin@xxxxxxxxx> Link: https://lore.kernel.org/r/20220925140406.112991-2-martin@xxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Stable-dep-of: 12c6223fc180 ("staging: r8188eu: fix led register settings") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> --- drivers/staging/r8188eu/core/rtw_led.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index e889e7861706..42e35953fd7b 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -53,7 +53,7 @@ static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) u8 LedCfg; int res; - if (padapter->bSurpriseRemoved || padapter->bDriverStopped) + if (padapter->bDriverStopped) goto exit; res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */ -- 2.35.1