diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-01-06 11:45:27 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:34 -0500 |
commit | b46d37e61f886e901ba0b504125b135f450a19b5 (patch) | |
tree | 381cfc7967847050b008bc7a255bc17e4674cdd4 /drivers/media/dvb/siano | |
parent | ad695510bf27a4e73e0d04d48d80c0b8389f17d2 (diff) |
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: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/siano')
-rw-r--r-- | drivers/media/dvb/siano/smscoreapi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index ca758bcb48c9..4bfd3451b568 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c | |||
@@ -1459,8 +1459,10 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, | |||
1459 | if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) { | 1459 | if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) { |
1460 | pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_REQ; | 1460 | pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_REQ; |
1461 | if (GetGpioPinParams(PinNum, &TranslatedPinNum, &GroupNum, | 1461 | if (GetGpioPinParams(PinNum, &TranslatedPinNum, &GroupNum, |
1462 | &groupCfg) != 0) | 1462 | &groupCfg) != 0) { |
1463 | return -EINVAL; | 1463 | rc = -EINVAL; |
1464 | goto free; | ||
1465 | } | ||
1464 | 1466 | ||
1465 | pMsg->msgData[1] = TranslatedPinNum; | 1467 | pMsg->msgData[1] = TranslatedPinNum; |
1466 | pMsg->msgData[2] = GroupNum; | 1468 | pMsg->msgData[2] = GroupNum; |
@@ -1490,6 +1492,7 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, | |||
1490 | else | 1492 | else |
1491 | sms_err("smscore_gpio_configure error"); | 1493 | sms_err("smscore_gpio_configure error"); |
1492 | } | 1494 | } |
1495 | free: | ||
1493 | kfree(buffer); | 1496 | kfree(buffer); |
1494 | 1497 | ||
1495 | return rc; | 1498 | return rc; |