[3/4] dmadev: fix potential null pointer access
Checks
Commit Message
From: Chengwen Feng <fengchengwen@huawei.com>
When rte_dma_vchan_status(dev_id, vchan, NULL) is called, a null pointer
access is triggered.
This patch adds the null pointer checker.
Fixes: 5e0f85912754 ("dmadev: add channel status check for testing use")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
lib/dmadev/rte_dmadev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -741,7 +741,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status *
{
struct rte_dma_dev *dev = &rte_dma_devices[dev_id];
- if (!rte_dma_is_valid(dev_id))
+ if (!rte_dma_is_valid(dev_id) || status == NULL)
return -EINVAL;
if (vchan >= dev->data->dev_conf.nb_vchans) {