qcacld-3.0: add NULL check before calling rps_enable cb

Add a NULL check before calling rps_enable callback
from ipa_set_rps_per_vdev and also add a check to avoid
disabling rps twice.

Change-Id: Ib63b2cda99aa332905df640ffa2d401c22845ad2
CRs-Fixed: 2876490
这个提交包含在:
Vevek Venkatesan
2021-02-18 18:32:42 +05:30
提交者 snandini
父节点 03c4b9c359
当前提交 d01d8ce465
修改 2 个文件,包含 4 行新增3 行删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -592,7 +592,8 @@ static inline
void ipa_set_rps_per_vdev(struct wlan_ipa_priv *ipa_ctx, uint8_t vdev_id,
bool enable)
{
ipa_ctx->rps_enable(vdev_id, enable);
if (ipa_ctx->rps_enable)
ipa_ctx->rps_enable(vdev_id, enable);
}
/**

查看文件

@@ -2437,7 +2437,7 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
if (iface_ctx)
wlan_ipa_cleanup_iface(iface_ctx);
if (qdf_ipa_get_lan_rx_napi())
if (qdf_ipa_get_lan_rx_napi() && ipa_ctx->sap_num_connected_sta)
ipa_set_rps_per_vdev(ipa_ctx, session_id, false);
qdf_mutex_release(&ipa_ctx->event_lock);