diff options
| author | Houston Hoffman <hhoffman@codeaurora.org> | 2017-03-13 15:05:16 -0700 |
|---|---|---|
| committer | Sandeep Puligilla <spuligil@codeaurora.org> | 2017-03-20 13:36:51 -0700 |
| commit | 3d70199bc719acbd1c2c3aa82ca7640639b26e14 (patch) | |
| tree | c1d7ab879c1433cc4f33f5ddcd7f068c95cdfb9c | |
| parent | d778a794fec74e083a64deddabef8f70341d9da4 (diff) | |
qcacld-3.0: Avoid dereferencing null tx_desc in ol_tx_ll_fast
In one version of ol_tx_ll_fast a null tx_desc will be dereferenced.
ol_tx_desc_vdev_update is called when tx_desc is guaranteed to not
be null. Move the vdev_id assignment into ol_tx_desc_vdev_update
to simplify the code and fix the null pointer dereference.
Change-Id: I01b2e81ee3f19cdf3f2f74ccc575df767891f472
CRs-Fixed: 2020708
| -rw-r--r-- | core/dp/txrx/ol_tx_desc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c index 9e2ad362fd2e..477a921ff53e 100644 --- a/core/dp/txrx/ol_tx_desc.c +++ b/core/dp/txrx/ol_tx_desc.c @@ -104,6 +104,7 @@ ol_tx_desc_vdev_update(struct ol_tx_desc_t *tx_desc, struct ol_txrx_vdev_t *vdev) { tx_desc->vdev = vdev; + tx_desc->vdev_id = vdev->vdev_id; } #ifdef CONFIG_PER_VDEV_TX_DESC_POOL @@ -156,8 +157,6 @@ struct ol_tx_desc_t *ol_tx_desc_alloc(struct ol_txrx_pdev_t *pdev, if (!tx_desc) return NULL; - tx_desc->vdev_id = vdev->vdev_id; - ol_tx_desc_vdev_update(tx_desc, vdev); ol_tx_desc_count_inc(vdev); qdf_atomic_inc(&tx_desc->ref_cnt); @@ -224,8 +223,6 @@ struct ol_tx_desc_t *ol_tx_desc_alloc(struct ol_txrx_pdev_t *pdev, pdev->pool_stats.pkt_drop_no_pool++; } - tx_desc->vdev_id = vdev->vdev_id; - return tx_desc; } |
