Commit e5ae8fa7 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarPawel Osciak <pawel@osciak.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent d935c57e
...@@ -854,6 +854,7 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx); ...@@ -854,6 +854,7 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx);
void vb2_dma_contig_cleanup_ctx(void *alloc_ctx) void vb2_dma_contig_cleanup_ctx(void *alloc_ctx)
{ {
if (!IS_ERR_OR_NULL(alloc_ctx))
kfree(alloc_ctx); kfree(alloc_ctx);
} }
EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx); EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment