qcacmn: Fix NULL dereference of peer from DP_STATS macros

Fix NULL dereference of peer from DP_STATS macros

Change-Id: I25b6269fe8e9b1deccaa38a7499167a156db6f37
CRs-Fixed: 2058483
This commit is contained in:
Yun Park 2017-06-08 10:15:42 -07:00 • committed by snandini
commit 22b406cc13
2 changed files with 8 additions and 6 deletions

View file

@ -74,24 +74,26 @@ while (0)
#ifndef DISABLE_DP_STATS
#define DP_STATS_INC(_handle, _field, _delta) \
{ \
_handle->stats._field += _delta; \
if (likely(_handle)) \
_handle->stats._field += _delta; \
}
#define DP_STATS_INCC(_handle, _field, _delta, _cond) \
{ \
if (_cond) { \
if (_cond && likely(_handle)) \
_handle->stats._field += _delta; \
} \
}
#define DP_STATS_DEC(_handle, _field, _delta) \
{ \
_handle->stats._field -= _delta; \
if (likely(_handle)) \
_handle->stats._field -= _delta; \
}
#define DP_STATS_UPD(_handle, _field, _delta) \
{ \
_handle->stats._field = _delta; \
if (likely(_handle)) \
_handle->stats._field = _delta; \
}
#define DP_STATS_INC_PKT(_handle, _field, _count, _bytes) \

View file

@ -1290,7 +1290,7 @@ done:
DP_STATS_INC_PKT(peer, rx.to_stack, 1,
pkt_len);
if ((pdev->enhanced_stats_en) &&
if ((pdev->enhanced_stats_en) && likely(peer) &&
hal_rx_attn_first_mpdu_get(rx_tlv_hdr)) {
if (soc->cdp_soc.ol_ops->update_dp_stats) {
soc->cdp_soc.ol_ops->update_dp_stats(