diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 62f4f05aa6b6..fbad35b350d7 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -511,6 +511,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) hdd_debug("P2P_SET GO noa: count=%d interval=%d duration=%d", count, interval, duration); duration = MS_TO_TU_MUS(duration); + interval = MS_TO_TU_MUS(interval); /* PS Selection * Periodic noa (2) * Single NOA (4) @@ -518,15 +519,21 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) noa.opp_ps = 0; noa.ct_window = 0; if (count == 1) { + if (duration > interval) + duration = interval; noa.duration = 0; noa.single_noa_duration = duration; noa.ps_selection = P2P_POWER_SAVE_TYPE_SINGLE_NOA; } else { + if (duration >= interval) { + hdd_err("Duration should be less than interval"); + return -EINVAL; + } noa.duration = duration; noa.single_noa_duration = 0; noa.ps_selection = P2P_POWER_SAVE_TYPE_PERIODIC_NOA; } - noa.interval = MS_TO_TU_MUS(interval); + noa.interval = interval; noa.count = count; noa.vdev_id = adapter->vdev_id;