From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <1350593239.2026.13.camel@aeonflux> Subject: Re: [PATCH 08/21] TTY: hci_ldisc, remove invalid check in open From: Marcel Holtmann To: Jiri Slaby Cc: gregkh@linuxfoundation.org, alan@linux.intel.com, linux-kernel@vger.kernel.org, jirislaby@gmail.com, Gustavo Padovan , Johan Hedberg , linux-bluetooth@vger.kernel.org Date: Thu, 18 Oct 2012 13:47:19 -0700 In-Reply-To: <1350592007-9216-9-git-send-email-jslaby@suse.cz> References: <1350592007-9216-1-git-send-email-jslaby@suse.cz> <1350592007-9216-9-git-send-email-jslaby@suse.cz> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: Hi Jiri, > hci_ldisc's open checks if tty_struct->disc_data is set. And if so it > returns with an error. But nothing ensures disc_data to be NULL. And > since ld->ops->open shall be called only once, we do not need the > check at all. So remove it. > > Note that this is not an issue now, but n_tty will start using the > disc_data pointer and this invalid 'if' would trigger then rendering > TTYs over BT unusable. > > Signed-off-by: Jiri Slaby > Cc: Marcel Holtmann > Cc: Gustavo Padovan > Cc: Johan Hedberg > Cc: linux-bluetooth@vger.kernel.org > --- > drivers/bluetooth/hci_ldisc.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) Acked-by: Marcel Holtmann Regards Marcel