This patch fixes two minor memory leaks in videobuf2-dma-sg module. They
might happen only in case some other operations (like memory allocation)
failed.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
fail_pages_alloc:
while (--i >= 0)
__free_page(buf->pages[i]);
+ kfree(buf->pages);
fail_pages_array_alloc:
vfree(buf->sg_desc.sglist);
num_pages_from_user, buf->sg_desc.num_pages);
while (--num_pages_from_user >= 0)
put_page(buf->pages[num_pages_from_user]);
+ kfree(buf->pages);
userptr_fail_pages_array_alloc:
vfree(buf->sg_desc.sglist);