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
This commit is contained in:
Vevek Venkatesan 2021-02-18 18:32:42 +05:30 • committed by snandini
commit 461295296a
2 changed files with 4 additions and 3 deletions

View file

@ -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);
}
/**

View file

@ -2357,7 +2357,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);