MLK-11911-2 mxc IPUv3: device: Correct bailout path for the ioctrl IPU_ALLOC
authorLiu Ying <Ying.Liu@freescale.com>
Thu, 26 Nov 2015 07:51:44 +0000 (15:51 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:16 +0000 (14:49 -0500)
commit40ca0efd4adb459e643b29180cb1ee0a2d1945a8
treee1d67d734bf337c925e14e09e21d870ef3261f08
parent28ad9fe3c8ee3077ac235a896f5eaa4bcabd1903
MLK-11911-2 mxc IPUv3: device: Correct bailout path for the ioctrl IPU_ALLOC

We should do the bailout dance correctly for the ioctrl IPU_ALLOC:
- Free the mem pointer.
- Free the DMA.
- Delete the mem->list from the ipu_alloc_list.

The potential memory leakage issue on the mem pointer is reported by Coverity:
if (get_user(size, argp))
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable mem going out of scope leaks the storage it points to.
return -EFAULT;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/mxc/ipu3/ipu_device.c