Commit ccf972bd authored by Pavel Machek's avatar Pavel Machek Committed by Greg Kroah-Hartman

Staging: dream: fix memory leak in camera error path

cppcheck found that ctrl_pmsm is leaked if the open operation fails.
Signed-off-by: default avatarEric Sesterhenn <eric.sesterhenn@lsexperts.de>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e79753ed
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment