lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 25 Nov 2016 10:22:04 +0530
From:   Shailendra Verma <shailendra.v@...sung.com>
To:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Lad Prabhakar <prabhakar.csengg@...il.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Shailendra Verma <shailendra.v@...sung.com>,
        Shailendra Verma <shailendra.capricorn@...il.com>
Cc:     vidushi.koul@...sung.com
Subject: [PATCH] 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@...sung.com>
---
 drivers/media/platform/davinci/vpfe_capture.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 6efb2f1..188b333 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -526,6 +526,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;
 		}
 	}
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ