DMA: svace fix: Add code for handling null (WGID: 58265).
authorJaejoon Yoo <joonyj7.yoo@samsung.com>
Wed, 28 Dec 2016 06:19:54 +0000 (15:19 +0900)
committerTaekki Kim <taekki.kim@samsung.com>
Mon, 14 May 2018 05:42:47 +0000 (14:42 +0900)
Change-Id: I168bd2e9effaa27ff1bdcdcce946905697f298b9
Signed-off-by: Jaejoon Yoo <joonyj7.yoo@samsung.com>
drivers/dma/pl330.c

index b5c831ee56ac23583979d63b1f028f718292b0b0..987309e2542915fbf4b63a47b50aa3d95b83f8a7 100644 (file)
@@ -2929,7 +2929,10 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
        }
 
        /* Return the last desc in the chain */
-       desc->txd.flags = flg;
+       if (desc)
+               desc->txd.flags = flg;
+       else
+               return NULL;
        return &desc->txd;
 }