From: Shailendra Verma Date: Fri, 25 Nov 2016 04:52:04 +0000 (-0200) Subject: [media] Staging: media: platform: davinci: - Fix for memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d39e74fdcdcca2e40f5397c3436bc9b8106a66a0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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; } }