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
This commit is contained in:
Alok Kumar 2018-02-19 15:10:34 +05:30 • committed by nshrivas
commit fa826fdba9

View file

@ -2780,6 +2780,9 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context)
{
struct hdd_adapter *adapter = NULL;
if (!context)
return 0;
adapter = (struct hdd_adapter *)context;
if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
@ -2797,7 +2800,12 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context)
*/
uint32_t cds_get_arp_stats_gw_ip(void *context)
{
struct hdd_adapter *adapter = (struct hdd_adapter *)context;
struct hdd_adapter *adapter = NULL;
if (!context)
return 0;
adapter = (struct hdd_adapter *)context;
if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,