From patchwork Wed Jan 6 16:45:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 71350 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o06HBsIe001087 for ; Wed, 6 Jan 2010 17:11:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932271Ab0AFRLw (ORCPT ); Wed, 6 Jan 2010 12:11:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932259Ab0AFRLw (ORCPT ); Wed, 6 Jan 2010 12:11:52 -0500 Received: from smtp.mujha-vel.cz ([81.30.225.246]:60869 "EHLO smtp.mujha-vel.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932254Ab0AFRLw (ORCPT ); Wed, 6 Jan 2010 12:11:52 -0500 X-Greylist: delayed 1580 seconds by postgrey-1.27 at vger.kernel.org; Wed, 06 Jan 2010 12:11:51 EST Received: from [217.66.174.142] (helo=localhost.localdomain) by smtp.mujha-vel.cz with esmtp (Exim 4.63) (envelope-from ) id 1NSZ0k-0007iT-7S; Wed, 06 Jan 2010 17:45:30 +0100 From: Jiri Slaby To: mchehab@infradead.org Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com, linux-media@vger.kernel.org Subject: [PATCH 1/2] media: dvb/siano, fix memory leak Date: Wed, 6 Jan 2010 17:45:27 +0100 Message-Id: <1262796328-17176-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.6.5.7 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index ca758bc..4bfd345 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;