Skip to content

Commit

Permalink
V4L/DVB (13963): siano, fix memory leak
Browse files Browse the repository at this point in the history
Stanse found a memory leak in smscore_gpio_configure. buffer is not
freed/assigned on all paths. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent ad69551 commit b46d37e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/media/dvb/siano/smscoreapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b46d37e

Please sign in to comment.