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>