summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorShailendra Verma <shailendra.v@samsung.com>2016-11-25 05:52:04 +0100
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-02-03 10:14:28 +0100
commitd39e74fdcdcca2e40f5397c3436bc9b8106a66a0 (patch)
treec4e7fcf937ba33a7c5f785e6f79d83e32cf1fc79 /drivers/media/platform
parent[media] b2c2: use IS_REACHABLE() instead of open-coding it (diff)
downloadlinux-d39e74fdcdcca2e40f5397c3436bc9b8106a66a0.tar.xz
linux-d39e74fdcdcca2e40f5397c3436bc9b8106a66a0.zip
[media] Staging: media: platform: davinci: - Fix for memory leak
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@s-opensource.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/davinci/vpfe_capture.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index e3a2b2e42128..e3fe3e0635aa 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -519,6 +519,8 @@ static int vpfe_open(struct file *file)
if (!vpfe_dev->initialized) {
if (vpfe_initialize_device(vpfe_dev)) {
mutex_unlock(&vpfe_dev->lock);
+ v4l2_fh_exit(&fh->fh);
+ kfree(fh);
return -ENODEV;
}
}