From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 28 Mar 2012 13:42:36 +0300 From: Johan Hedberg To: Marcel Holtmann Cc: David Herrmann , linux-bluetooth@vger.kernel.org, padovan@profusion.mobi Subject: Re: [PATCH] Bluetooth: vhci: Ignore return code of nonseekable_open() Message-ID: <20120328104236.GA6653@x220> References: <1332928122-10919-1-git-send-email-dh.herrmann@googlemail.com> <1332930313.1870.164.camel@aeonflux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1332930313.1870.164.camel@aeonflux> List-ID: Hi, On Wed, Mar 28, 2012, Marcel Holtmann wrote: > > The comment in ./fs/open.c clearly states that nonseekable_open() will > > never fail. Therefore, we can safely ignore the return code. This is the > > recommended way to deal with nonseekable_open(). > > Our current code looks like nonseekable_open() is checked for the return > > code. However, if we check the return code, we must also kfree() our > > private data if the open fails. To avoid this overhead and to avoid > > confusion, we simply drop the return code and return 0. > > > > Signed-off-by: David Herrmann > > --- > > See the UHID discussion for more information. Marcel suggested to also fix vhci > > so here is the patch ;) > > > > drivers/bluetooth/hci_vhci.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Acked-by: Marcel Holtmann Applied to bluetooth-next. Thanks. Johan