Skip to content

Commit

Permalink
lib/dma: add null check for vchan info validation
Browse files Browse the repository at this point in the history
This patch adds null check for vchan info validation

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Change-Id: Ifbf35693285ece04d42b940eeaa562f9485984f1
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/144151
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
ShivaShankarKommula authored and jerinjacobk committed Jan 28, 2025
1 parent cf65772 commit efde8c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/common/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ dao_dma_lcore_mem2dev_autofree_set(int16_t mem2dev_id, uint16_t vchan, bool enab
struct dao_dma_vchan_info *vchan_info = RTE_PER_LCORE(dao_dma_vchan_info);
int i;

if (!vchan_info)
return -ENOMEM;

for (i = 0; i < vchan_info->nb_mem2dev; i++) {
if (vchan_info->mem2dev[i].devid == mem2dev_id &&
vchan_info->mem2dev[i].vchan == vchan) {
Expand Down

0 comments on commit efde8c0

Please sign in to comment.