提交 b46d37e6 编写于 作者: J Jiri Slaby 提交者: Mauro Carvalho Chehab

V4L/DVB (13963): siano, fix memory leak

Stanse found a memory leak in smscore_gpio_configure. buffer is not
freed/assigned on all paths. Fix that.
Signed-off-by: NJiri Slaby <jslaby@suse.cz>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ad695510
......@@ -1459,8 +1459,10 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum,
if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) {
pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_REQ;
if (GetGpioPinParams(PinNum, &TranslatedPinNum, &GroupNum,
&groupCfg) != 0)
return -EINVAL;
&groupCfg) != 0) {
rc = -EINVAL;
goto free;
}
pMsg->msgData[1] = TranslatedPinNum;
pMsg->msgData[2] = GroupNum;
......@@ -1490,6 +1492,7 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum,
else
sms_err("smscore_gpio_configure error");
}
free:
kfree(buffer);
return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册