diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-11-18 13:51:00 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-25 11:52:18 +0100 |
commit | e5ae8fa739f8a1d5c292c5b13fa33ac64166e5a0 (patch) | |
tree | a6c2347cc669c293f70412f33780902317764340 | |
parent | [media] vb2: add dma_dir to the alloc memop (diff) | |
download | linux-e5ae8fa739f8a1d5c292c5b13fa33ac64166e5a0.tar.xz linux-e5ae8fa739f8a1d5c292c5b13fa33ac64166e5a0.zip |
[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); 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); |