From: Jiri Slaby Date: Wed, 6 Jan 2010 16:45:27 +0000 (-0300) Subject: V4L/DVB (13963): siano, fix memory leak X-Git-Tag: v2.6.34-rc1~280^2~271 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=b46d37e61f886e901ba0b504125b135f450a19b5;p=net-next-2.6.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index ca758bcb48c..4bfd3451b56 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, 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;