* [PATCH 3/3] staging/dream: fix memory leak in camera error path
@ 2009-11-21 8:16 Pavel Machek
0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2009-11-21 8:16 UTC (permalink / raw)
To: Arve Hj?nnev?g, kernel list, linux-arm-kernel, Brian Swetland,
San Mehat, Daniel Walker, Iliyan Malchev, Greg KH
cppcheck found that ctrl_pmsm is leaked if the open operation fails.
Signed-off-by: Eric Sesterhenn <eric.sesterhenn@lsexperts.de>
Signed-off-by: Pavel Machek <pavel@ucw.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-21 8:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-21 8:16 [PATCH 3/3] staging/dream: fix memory leak in camera error path Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox