1
0
Fork 0

[media] vb2: don't free alloc context if it is ERR_PTR

Don't try to free a pointer containing an ERR_PTR().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
hifive-unleashed-5.1
Hans Verkuil 2014-11-18 09:51:00 -03:00 committed by Mauro Carvalho Chehab
parent d935c57e8f
commit e5ae8fa739
1 changed files with 2 additions and 1 deletions

View File

@ -854,7 +854,8 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx);
void vb2_dma_contig_cleanup_ctx(void *alloc_ctx)
{
kfree(alloc_ctx);
if (!IS_ERR_OR_NULL(alloc_ctx))
kfree(alloc_ctx);
}
EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx);