[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20091121081647.GC2597@elf.ucw.cz>
Date: Sat, 21 Nov 2009 09:16:47 +0100
From: Pavel Machek <pavel@....cz>
To: Arve Hj?nnev?g <arve@...roid.com>,
kernel list <linux-kernel@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Brian Swetland <swetland@...gle.com>,
San Mehat <san@...gle.com>, Daniel Walker <dwalker@...o99.com>,
Iliyan Malchev <malchev@...gle.com>, Greg KH <greg@...ah.com>
Subject: [PATCH 3/3] staging/dream: fix memory leak in camera error path
cppcheck found that ctrl_pmsm is leaked if the open operation fails.
Signed-off-by: Eric Sesterhenn <eric.sesterhenn@...xperts.de>
Signed-off-by: Pavel Machek <pavel@....cz>
diff --git a/drivers/staging/dream/camera/msm_camera.c b/drivers/staging/dream/camera/msm_camera.c
index 7d93877..87e118d 100644
--- a/drivers/staging/dream/camera/msm_camera.c
+++ b/drivers/staging/dream/camera/msm_camera.c
@@ -1885,8 +1885,10 @@ static int msm_open_control(struct inode *inode, struct file *filep)
return -ENOMEM;
rc = msm_open_common(inode, filep, 0);
- if (rc < 0)
+ if (rc < 0) {
+ kfree(ctrl_pmsm);
return rc;
+ }
ctrl_pmsm->pmsm = filep->private_data;
filep->private_data = ctrl_pmsm;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists