diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-11-18 07:51:00 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-25 05:52:18 -0500 |
commit | e5ae8fa739f8a1d5c292c5b13fa33ac64166e5a0 (patch) | |
tree | a6c2347cc669c293f70412f33780902317764340 | |
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>
-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); | |||
854 | 854 | ||
855 | void vb2_dma_contig_cleanup_ctx(void *alloc_ctx) | 855 | void vb2_dma_contig_cleanup_ctx(void *alloc_ctx) |
856 | { | 856 | { |
857 | kfree(alloc_ctx); | 857 | if (!IS_ERR_OR_NULL(alloc_ctx)) |
858 | kfree(alloc_ctx); | ||
858 | } | 859 | } |
859 | EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx); | 860 | EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx); |
860 | 861 | ||