提交 ccf972bd 编写于 作者: P Pavel Machek 提交者: 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: NEric Sesterhenn <eric.sesterhenn@lsexperts.de>
Signed-off-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部