From ed577367b417b950b1ab7c828564d80a8e0c10df Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Tue, 28 Apr 2020 10:09:21 -0700 Subject: [PATCH] qcacld-3.0: Check hdd_ctx for null in hdd_get_bandwidth_level Check for hdd_context validity before accessing current throughput level in hdd_get_bandwidth_level. Change-Id: I8cb3a0e484e4350938e28c4f704498aa24ed2c14 CRs-Fixed: 2669231 --- core/hdd/src/wlan_hdd_driver_ops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 79c367cf679a..47852548d660 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -84,9 +84,13 @@ static inline void hdd_remove_pm_qos(struct device *dev) */ static int hdd_get_bandwidth_level(void *data) { + int ret = PLD_BUS_WIDTH_NONE; struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); - return hdd_get_current_throughput_level(hdd_ctx); + if (hdd_ctx) + ret = hdd_get_current_throughput_level(hdd_ctx); + + return ret; } /**