mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
qcacmn: Add NULL check while iterating sgl entries
__qdf_dma_get_sgtable_dma_addr() iterates through sgl entries without appropriately checking for NULL pointers before attempting to access them. Fix the above-mentioned issue by adding a NULL check before access. Change-Id: I7456db834f71b9b5cf3cb254526177b9fdcee664 CRs-Fixed: 2448239
This commit is contained in:
parent
51264a63e1
commit
8e8f71952b
1 changed files with 5 additions and 1 deletions
|
|
@ -288,8 +288,12 @@ __qdf_dma_get_sgtable_dma_addr(struct sg_table *sgt)
|
|||
struct scatterlist *sg;
|
||||
int i;
|
||||
|
||||
for_each_sg(sgt->sgl, sg, sgt->nents, i)
|
||||
for_each_sg(sgt->sgl, sg, sgt->nents, i) {
|
||||
if (!sg)
|
||||
break;
|
||||
|
||||
sg->dma_address = sg_phys(sg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue