diff --git a/core/hdd/src/wlan_hdd_twt.c b/core/hdd/src/wlan_hdd_twt.c index 05977120b16e..14a03fcced35 100644 --- a/core/hdd/src/wlan_hdd_twt.c +++ b/core/hdd/src/wlan_hdd_twt.c @@ -2728,22 +2728,25 @@ static int hdd_twt_pause_session(struct hdd_adapter *adapter, qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes, QDF_MAC_ADDR_SIZE); params.vdev_id = adapter->vdev_id; + params.dialog_id = 0; - ret = wlan_cfg80211_nla_parse_nested(tb, + if (twt_param_attr) { + ret = wlan_cfg80211_nla_parse_nested(tb, QCA_WLAN_VENDOR_ATTR_TWT_SETUP_MAX, twt_param_attr, qca_wlan_vendor_twt_add_dialog_policy); - if (ret) { - hdd_debug("command parsing failed"); - return ret; - } + if (ret) { + hdd_debug("command parsing failed"); + return ret; + } - id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_FLOW_ID; - if (tb[id]) { - params.dialog_id = nla_get_u8(tb[id]); + id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_FLOW_ID; + if (tb[id]) + params.dialog_id = nla_get_u8(tb[id]); + else + hdd_debug("TWT: FLOW_ID not specified. set to zero"); } else { - params.dialog_id = 0; - hdd_debug("TWT: FLOW_ID not specified. set to zero"); + hdd_debug("TWT param not present. flow id set to zero"); } status = hdd_twt_check_all_twt_support(adapter->hdd_ctx->psoc, @@ -3877,7 +3880,8 @@ static int hdd_twt_configure(struct hdd_adapter *adapter, twt_param_attr = tb[id]; if (!twt_param_attr && - twt_oper != QCA_WLAN_TWT_GET_CAPABILITIES) { + twt_oper != QCA_WLAN_TWT_GET_CAPABILITIES && + twt_oper != QCA_WLAN_TWT_SUSPEND) { hdd_err("TWT parameters NOT specified"); return -EINVAL; }