diff options
| author | Alok Kumar <alokkuma@codeaurora.org> | 2018-02-19 15:10:34 +0530 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2018-02-19 20:38:24 -0800 |
| commit | 2c15cb3a5efd6ef5196345bba668a6ccfe86905e (patch) | |
| tree | b68352693692462037efdfb13b137fd6605ebec4 | |
| parent | 1107891f15571da49ec9075ed70e4d9ad25b0b7a (diff) | |
qcacld-3.0: Fix Null pointer dereference issue
Add null check for context in cds_get_connectivity_stats_pkt_bitmap
and cds_get_arp_stats_gw_ip to avoid Null dereferencing.
Change-Id: I3481508ee62f630b9db580fdf7d73821733d1599
CRs-Fixed: 2191518
| -rw-r--r-- | core/cds/src/cds_api.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index b6e42932546a..6eb52ebc6916 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -2768,6 +2768,9 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context) { hdd_adapter_t *adapter = NULL; + if (!context) + return 0; + adapter = (hdd_adapter_t *)context; if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) { QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR, @@ -2785,7 +2788,12 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context) */ uint32_t cds_get_arp_stats_gw_ip(void *context) { - hdd_adapter_t *adapter = (hdd_adapter_t *)context; + hdd_adapter_t *adapter = NULL; + + if (!context) + return 0; + + adapter = (hdd_adapter_t *)context; if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) { QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR, |
