Skip to content

Commit de6395d

Browse files
ArunmaniAlagarsamy2710kartben
authored andcommitted
drivers: wifi: siwx91x: Handle error case in power save mode
Power save is not supported in AP mode. This commit ensures that `-EINVAL` is returned instead of success, preventing incorrect behavior. Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
1 parent 112c8e6 commit de6395d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/wifi/siwx91x/siwx91x_wifi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,13 @@ static int siwx91x_apply_power_save(struct siwx91x_dev *sidev)
282282

283283
interface = sl_wifi_get_default_interface();
284284
if (FIELD_GET(SIWX91X_INTERFACE_MASK, interface) != SL_WIFI_CLIENT_INTERFACE) {
285-
return 0;
285+
LOG_ERR("Wi-Fi not in station mode");
286+
return -EINVAL;
286287
}
287288

288289
if (sidev->state == WIFI_STATE_INTERFACE_DISABLED) {
289-
return 0;
290+
LOG_ERR("Command given in invalid state");
291+
return -EINVAL;
290292
}
291293

292294
sl_wifi_get_performance_profile(&sl_ps_profile);

0 commit comments

Comments
 (0)