Skip to content

Commit

Permalink
[media] vb2: don't free alloc context if it is ERR_PTR
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Nov 25, 2014
1 parent d935c57 commit e5ae8fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/v4l2-core/videobuf2-dma-contig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e5ae8fa

Please sign in to comment.