qcacld-3.0: Handle NULL pdev in cds_flush_cache_rx_queue()

Currently cds_flush_cache_rx_queue() does not verify that
cds_get_context() returns a valid pdev which could subsequently lead
to dereferencing an invalid pointer.  Add a validity check for this
pointer.

Change-Id: I326e0b92205fda78854c947248e675d287a7ec04
CRs-Fixed: 1082035
(cherry picked from commit 514e12df3c66ef0e457d76ef8c984874481f5117)
This commit is contained in:
Jeff Johnson 2016-10-25 08:43:07 -07:00 • committed by qcabuildsw
commit 28b7151d8d

View file

@ -836,7 +836,11 @@ void cds_flush_cache_rx_queue(void)
{
uint8_t sta_id;
struct ol_txrx_peer_t *peer;
struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
struct ol_txrx_pdev_t *pdev;
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
if (!pdev)
return;
for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT; sta_id++) {
peer = ol_txrx_peer_find_by_local_id(pdev, sta_id);