From patchwork Sun Sep 4 19:38:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Rankin X-Patchwork-Id: 1124222 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p84JcLoW016997 for ; Sun, 4 Sep 2011 19:38:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753217Ab1IDTiU (ORCPT ); Sun, 4 Sep 2011 15:38:20 -0400 Received: from nm2-vm0.bt.bullet.mail.ukl.yahoo.com ([217.146.182.242]:49073 "HELO nm2-vm0.bt.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753152Ab1IDTiT (ORCPT ); Sun, 4 Sep 2011 15:38:19 -0400 Received: from [217.146.183.195] by nm2.bt.bullet.mail.ukl.yahoo.com with NNFMP; 04 Sep 2011 19:38:17 -0000 Received: from [217.146.183.203] by tm1.bt.bullet.mail.ukl.yahoo.com with NNFMP; 04 Sep 2011 19:38:17 -0000 Received: from [127.0.0.1] by omp1001.bt.mail.ukl.yahoo.com with NNFMP; 04 Sep 2011 19:38:17 -0000 X-Yahoo-Newman-Id: 545207.63990.bm@omp1001.bt.mail.ukl.yahoo.com Received: (qmail 38150 invoked from network); 4 Sep 2011 19:38:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type; b=mVm+cdqkbdHP95SUgk5zoPjtNou12T/8apiYD+Iy8bpy6/VrPNupLVgkhSn18arLcBbwtik3E5Joe3e0x5VOzt2Ll1oJurh0uGapGnRJGTqP2CFXrvg5+CBwuF5IwG5BYyhMV01on2KtqfwaXbwxRLuvADPnZ9lYEEtxLpW2Au0= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1315165097; bh=VihSEgYa5mqT+Af2gNdq72gZcWjZcOn+97svn+aRvm8=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type; b=sD20uqTubWk/NQ1si6SGB6MQVOzQqBZnHqFLsOEKjn20PEqNEghAPmWISyeJrl4GQBTAyBmNswq9X1PNOMmR/5aijyJ01tkAwh0BjEep1XnTztaDOJylXUF/J7ujkVIzFLkmLAb+UDXn4xdlEi/5+I9ux7sd8FpgpxcO1g+Jycc= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: RhlIKcgVM1kAtvau8.v9MtNE9GXOggTf8Dw_74qI6o.WV4a iY6r6kWNZ2_p14WdYGEHfYTHCeD6Wx_jILPTLNgoXN5OmcyQGwThCeTv_viv xs9YCtQAxHnbJDCDI.L.fMdG3DhYW92o6IK96q9pY5dWzD8YBT.s7XeGeCbk uSc2YRIW.uP41kclmj8jjAn2aCqovbL5aIbqXs9EyrKFURR_FreGNE2ZwkGM drpfwTfbjNmARMNRxrIdoEvvsOogveevaV5F_mxQkcEUK4r_l2KSHW.mpUNh q9MZWSyyFAQ8Kapp3yCaT8lRaW9OwnlqoSXqyTX.SNbIkC68lzMgovI7S3i7 EIfeg1gA9FJTGV_6Jk_53XxtlgzuWqjmAoz4f7PABBfOViq06nnc26LCGobn 52A-- X-Yahoo-SMTP: dMK34oyswBBlfKesWTI5ovDjFOUFE6shtILt.ZXnUEjQHhWq Received: from wellhouse.underworld (rankincj@86.183.126.7 with login) by smtp816.mail.ird.yahoo.com with SMTP; 04 Sep 2011 19:38:17 +0000 GMT Received: from volcano.underworld (volcano.underworld [192.168.0.3]) by wellhouse.underworld (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p84JcEp5012254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 4 Sep 2011 20:38:16 +0100 Message-ID: <4E63D3A6.3010505@yahoo.com> Date: Sun, 04 Sep 2011 20:38:14 +0100 From: Chris Rankin User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20110816 Thunderbird/6.0 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: linux-media@vger.kernel.org Subject: [PATCH 1/1] EM28xx - Fix memory leak on disconnect or error. Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 04 Sep 2011 19:38:22 +0000 (UTC) Mauro, This patch seems to have been missed, so I'm resending it. Release the dev->alt_max_pkt_size buffer in all cases. Signed-off-by: Chris Rankin Cheers, Chris --- linux/drivers/media/video/em28xx/em28xx-cards.c.orig 2011-09-04 20:30:14.000000000 +0100 +++ linux/drivers/media/video/em28xx/em28xx-cards.c 2011-09-04 20:28:59.000000000 +0100 @@ -3200,6 +3200,7 @@ retval = em28xx_init_dev(&dev, udev, interface, nr); if (retval) { mutex_unlock(&dev->lock); + kfree(dev->alt_max_pkt_size); kfree(dev); goto err; } --- linux/drivers/media/video/em28xx/em28xx-video.c.orig 2011-09-04 20:16:52.000000000 +0100 +++ linux/drivers/media/video/em28xx/em28xx-video.c 2011-09-04 20:27:41.000000000 +0100 @@ -2200,6 +2200,7 @@ free the remaining resources */ if (dev->state & DEV_DISCONNECTED) { em28xx_release_resources(dev); + kfree(dev->alt_max_pkt_size); kfree(dev); return 0; }