From: David Herrmann Date: Wed, 28 Mar 2012 09:48:42 +0000 (+0200) Subject: Bluetooth: vhci: Ignore return code of nonseekable_open() X-Git-Tag: v3.5-rc1~35^2~3^2~18^2^2~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dea0141a9d9c33a669c546f8f5d9f44a0557375;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git Bluetooth: vhci: Ignore return code of nonseekable_open() 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 Acked-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 158bfe5..3f72595 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -252,8 +252,9 @@ static int vhci_open(struct inode *inode, struct file *file) } file->private_data = data; + nonseekable_open(inode, file); - return nonseekable_open(inode, file); + return 0; } static int vhci_release(struct inode *inode, struct file *file)