]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commit
zynqmp_dma: Fix race condition in the prep_sg
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Wed, 2 Aug 2017 09:07:07 +0000 (14:37 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 2 Aug 2017 10:58:03 +0000 (12:58 +0200)
commitbbd4291ae5ecfbad699c2595f6db71d89536ab23
treee8757e7ebf814ff6ef036d13c45af68d01feecaf
parent6b3aa1785e4630ec15fd2f25fc7a8e4b00b19924
zynqmp_dma: Fix race condition in the prep_sg

Currently driver is allocating a descriptor at the
beginning of the prep_sg(), after that checking for length
of the descriptor it may set to NULL.

In this case we should either free the allocated descriptor
or allocate descriptor after checking for the size of the
descriptor, instead of allocating the descriptor at the
beginning of the prep_sg().

This patch fixes this issue.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/dma/xilinx/zynqmp_dma.c