[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1106021110390.1913-100000@iolanthe.rowland.org>
Date:	Thu, 2 Jun 2011 11:17:08 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Julia Lawall <julia@...u.dk>
cc:	David Brownell <dbrownell@...rs.sourceforge.net>,
	<kernel-janitors@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers/usb/gadget/inode.c: add missing kfree
On Thu, 2 Jun 2011, Julia Lawall wrote:
> > 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.
I don't either, since as far as I know the "if" condition can never be 
true.  You may be able to verify this just by reading the code.  Note 
that dev_config is used only as a field in dev_init_operations, which 
is used only in the gadgetfs_fill_super routine and therefore only when 
a file in this filesystem is opened.
Note also that the only time dev->buf becomes non-NULL is when
dev_config() succeeds, at which point fd->f_op is switched from
dev_init_operations to ep0_io_operations.  Therefore dev_config()
cannot be called successfully more than once for the same open file.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
