Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752707Ab1FBO4m (ORCPT ); Thu, 2 Jun 2011 10:56:42 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:56535 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544Ab1FBO4l (ORCPT ); Thu, 2 Jun 2011 10:56:41 -0400 Date: Thu, 2 Jun 2011 16:56:35 +0200 (CEST) From: Julia Lawall To: Alan Stern Cc: David Brownell , kernel-janitors@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/usb/gadget/inode.c: add missing kfree In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1091 Lines: 36 On Thu, 2 Jun 2011, Alan Stern wrote: > On Thu, 2 Jun 2011, Julia Lawall wrote: > > > From: Julia Lawall > > > > The label fail frees dev->buf, but kbuf hasn't yet been stored there at > > this point. > > ... > > > Signed-off-by: Julia Lawall > > > > --- > > I wonder if it is really correct to free dev->buf at fail in this case. > > Because it is freeing the previously allocated value of dev->buf, not the > > current one as done in subsequent cases. > > I don't think it matters. This check is probably there only for > safety; it should not be possible for dev->buf to be non-NULL at this > point. You ought to be able to remove the entire > > if (dev->buf) > goto fail; > > statement with no ill effects. I can send such a patch if you think it is OK. But I have no way to test it. julia -- 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/