summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-11-18 09:51:00 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-25 08:52:18 -0200
commite5ae8fa739f8a1d5c292c5b13fa33ac64166e5a0 (patch)
treea6c2347cc669c293f70412f33780902317764340
parentd935c57e8fb6902a9ede603bb55d9e158f75f09a (diff)
[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>
-rw-r--r--drivers/media/v4l2-core/videobuf2-dma-contig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c
index c4305bf3dbed..0bfc488c8812 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -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);