diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-11-18 09:51:00 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-25 08:52:18 -0200 |
commit | e5ae8fa739f8a1d5c292c5b13fa33ac64166e5a0 (patch) | |
tree | a6c2347cc669c293f70412f33780902317764340 /drivers/media/v4l2-core/videobuf2-dma-contig.c | |
parent | d935c57e8fb6902a9ede603bb55d9e158f75f09a (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>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-dma-contig.c')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-dma-contig.c | 3 |
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); |