summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShailendra Verma <shailendra.v@samsung.com>2016-11-25 05:57:34 +0100
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-29 22:39:47 +0200
commit6995a659101bd4effa41cebb067f9dc18d77520d (patch)
treef56d6beb591765cccd11d3bb3f1bfed403d677de /drivers
parentmedia: videobuf-dma-contig: Use size of buffer in mmap not vma size (diff)
downloadlinux-6995a659101bd4effa41cebb067f9dc18d77520d.tar.xz
linux-6995a659101bd4effa41cebb067f9dc18d77520d.zip
media: staging: media: davinci_vpfe: - Fix for memory leak if decoder initialization fails.
Fix to avoid possible memory leak if the decoder initialization got failed.Free the allocated memory for file handle object before return in case decoder initialization fails. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/davinci_vpfe/vpfe_video.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index 510202a3b091..84cca18e3e9d 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -419,6 +419,9 @@ static int vpfe_open(struct file *file)
/* If decoder is not initialized. initialize it */
if (!video->initialized && vpfe_update_pipe_state(video)) {
mutex_unlock(&video->lock);
+ v4l2_fh_del(&handle->vfh);
+ v4l2_fh_exit(&handle->vfh);
+ kfree(handle);
return -ENODEV;
}
/* Increment device users counter */