diff options
author | Shailendra Verma <shailendra.v@samsung.com> | 2016-11-25 02:52:04 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-02-03 07:14:28 -0200 |
commit | d39e74fdcdcca2e40f5397c3436bc9b8106a66a0 (patch) | |
tree | c4e7fcf937ba33a7c5f785e6f79d83e32cf1fc79 /drivers/media/platform/davinci | |
parent | 30f895a9e1df6a44cef6e4e0fad70762026b8512 (diff) | |
download | talos-obmc-linux-d39e74fdcdcca2e40f5397c3436bc9b8106a66a0.tar.gz talos-obmc-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/davinci')
-rw-r--r-- | drivers/media/platform/davinci/vpfe_capture.c | 2 |
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; } } |