Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: Return early for error conditions

Do not try to cancel work instances and ANI when
the device is not present or WOW triggers are
not configured. Bail out early and use ath_err()
for such error conditions.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Sujith Manoharan and committed by
Kalle Valo
13084c2d 4895efc9

+6 -6
+6 -6
drivers/net/wireless/ath/ath9k/wow.c
··· 197 197 198 198 mutex_lock(&sc->mutex); 199 199 200 - ath_cancel_work(sc); 201 - ath_stop_ani(sc); 202 - 203 200 if (test_bit(ATH_OP_INVALID, &common->op_flags)) { 204 - ath_dbg(common, ANY, "Device not present\n"); 205 - ret = -EINVAL; 201 + ath_err(common, "Device not present\n"); 202 + ret = -ENODEV; 206 203 goto fail_wow; 207 204 } 208 205 209 206 if (WARN_ON(!wowlan)) { 210 - ath_dbg(common, WOW, "None of the WoW triggers enabled\n"); 207 + ath_err(common, "None of the WoW triggers enabled\n"); 211 208 ret = -EINVAL; 212 209 goto fail_wow; 213 210 } 211 + 212 + ath_cancel_work(sc); 213 + ath_stop_ani(sc); 214 214 215 215 if (!device_can_wakeup(sc->dev)) { 216 216 ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");