From naranjo.manuel@gmail.com Wed Nov 15 10:14:28 2006 Date: Wed, 15 Nov 2006 15:14:27 -0300 From: Naranjo Manuel Francisco To: Cc: gregkh@suse.de, linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: USB: fix aircable.c: inconsequent NULL checking Message-ID: <20061115151427.47ffdd75@manuel> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII > 2006/11/11, Adrian Bunk : > > The Coverity checker spotted the following in > > drivers/usb/serial/aircable.c: > > > > <-- snip --> > > > > ... > > static void aircable_read(void *params) > > { > > ... Hi everyone, Sorry for the long time response but here is the patch, I think this way should work, if anyone has any suggestion let me know. What I do now is, in case I don't have the tty available I reschedule the work, I have tried it and it works with no problem, I even tried removing the device, and didn't find anything strange. Signed-off-by: Naranjo Manuel Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/aircable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/usb/serial/aircable.c +++ gregkh-2.6/drivers/usb/serial/aircable.c @@ -270,8 +270,11 @@ static void aircable_read(void *params) */ tty = port->tty; - if (!tty) + if (!tty) { schedule_work(&priv->rx_work); + err("%s - No tty available", __FUNCTION__); + return ; + } count = min(64, serial_buf_data_avail(priv->rx_buf));