Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161008AbWJOQft (ORCPT ); Sun, 15 Oct 2006 12:35:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161011AbWJOQft (ORCPT ); Sun, 15 Oct 2006 12:35:49 -0400 Received: from py-out-1112.google.com ([64.233.166.177]:1829 "EHLO py-out-1112.google.com") by vger.kernel.org with ESMTP id S1161008AbWJOQfs (ORCPT ); Sun, 15 Oct 2006 12:35:48 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=sTFa/lRxYCgsU41PxmwKXTH1CAPV70/dJWzcBd1WxsFY/1bNnuAXwA3smNR0Bq2x9FbW+xwVZQelvSkrxbOWFA+gjZiGxMICzUvfgmEv7v8e2YXR4SC/EA9R8bbP07PGhJPTEXnU/2tNjFhacXTSgQCdU7KvCFJvj9W3RaC1YTY= Message-ID: <45326359.4000502@gmail.com> Date: Sun, 15 Oct 2006 20:35:37 +0400 From: Manu Abraham User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Florin Malita CC: Trent Piepho , v4l-dvb maintainer list , linux-kernel@vger.kernel.org, Mauro Carvalho Chehab Subject: Re: [v4l-dvb-maintainer] [PATCH] V4L/DVB: potential leak in dvb-bt8xx References: <453120EC.8030503@gmail.com> <45325B9E.1030808@gmail.com> In-Reply-To: <45325B9E.1030808@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1379 Lines: 42 Florin Malita wrote: > Trent Piepho wrote: >> I believe that 'state' will be kfree'd by the dst_attach() function if there >> is a failure. Not what you would expect, to have it allocated in the bt8xx >> driver (why do is there??) and freed on error in a different function. >> > > Hm, you're right - it is kfreed in dst_attach(). But we're still missing > the kmalloc result check... > > Signed-off-by: Florin Malita > --- > > dvb-bt8xx.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c > index fb6c4cc..d22ba4e 100644 > --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c > +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c > @@ -665,6 +665,9 @@ static void frontend_init(struct dvb_bt8 > case BTTV_BOARD_TWINHAN_DST: > /* DST is not a frontend driver !!! */ > state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL); > + if (!state) > + break; > + > /* Setup the Card */ > state->config = &dst_config; > state->i2c = card->i2c_adapter; > This patch was applied a few days back Manu - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/