diff options
| author | Jeff Johnson <jjohnson@codeaurora.org> | 2016-10-25 08:43:07 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-28 18:04:21 -0700 |
| commit | 28b7151d8d8ecd3061b27f503f22c3dc94199812 (patch) | |
| tree | 1c7a1901afd609e5c19b81aaabc75d6315c38a23 | |
| parent | 02a1276b1f6cf1fe52fd3938e44b7a69d5d14c99 (diff) | |
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)
| -rw-r--r-- | core/cds/src/cds_api.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 88cab038f21a..b5cfa3285cee 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -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); |
