diff options
author | Pavel Machek <pavel@ucw.cz> | 2009-11-21 09:16:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 16:42:26 -0800 |
commit | ccf972bd6bcb35ebd38e0a530c86088e45102aa4 (patch) | |
tree | 454a16f4ae35c9f8022e58c1e8f7875b1f49dae4 /drivers/staging/dream | |
parent | e79753edf88d858a3783c946c12cc4726f6590f6 (diff) |
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@lsexperts.de>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/dream')
-rw-r--r-- | drivers/staging/dream/camera/msm_camera.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/dream/camera/msm_camera.c b/drivers/staging/dream/camera/msm_camera.c index 7d938772eac..87e118d1882 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; |