USB: fix aircable.c: inconsequent NULL checking

> 2006/11/11, Adrian Bunk <bunk@stusta.de>:
> > 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 <naranjo.manuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Naranjo Manuel Francisco 2006-11-15 15:14:27 -03:00 committed by Greg Kroah-Hartman
parent 1b7be3c066
commit 7a5c7b42d3

View File

@ -270,8 +270,11 @@ static void aircable_read(void *params)
*/ */
tty = port->tty; tty = port->tty;
if (!tty) if (!tty) {
schedule_work(&priv->rx_work); schedule_work(&priv->rx_work);
err("%s - No tty available", __FUNCTION__);
return ;
}
count = min(64, serial_buf_data_avail(priv->rx_buf)); count = min(64, serial_buf_data_avail(priv->rx_buf));