]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/ppp_synctty.c
[netdrvr] fix array overflows in Chelsio driver
[linux-2.6-omap-h63xx.git] / drivers / net / ppp_synctty.c
index fd9f50180355b79bef8ae07a7fe44b68621a59f5..33cb8254e79dac71b1d7e9d676f3c70b8a00f97e 100644 (file)
@@ -237,7 +237,7 @@ ppp_sync_open(struct tty_struct *tty)
                goto out_free;
 
        tty->disc_data = ap;
-
+       tty->receive_room = 65536;
        return 0;
 
  out_free:
@@ -384,12 +384,6 @@ ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
        return 0;
 }
 
-static int
-ppp_sync_room(struct tty_struct *tty)
-{
-       return 65535;
-}
-
 /*
  * This can now be called from hard interrupt level as well
  * as soft interrupt level or mainline.
@@ -406,7 +400,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
        spin_lock_irqsave(&ap->recv_lock, flags);
        ppp_sync_input(ap, buf, cflags, count);
        spin_unlock_irqrestore(&ap->recv_lock, flags);
-       if (skb_queue_len(&ap->rqueue))
+       if (!skb_queue_empty(&ap->rqueue))
                tasklet_schedule(&ap->tsk);
        sp_put(ap);
        if (test_and_clear_bit(TTY_THROTTLED, &tty->flags)
@@ -439,7 +433,6 @@ static struct tty_ldisc ppp_sync_ldisc = {
        .write  = ppp_sync_write,
        .ioctl  = ppp_synctty_ioctl,
        .poll   = ppp_sync_poll,
-       .receive_room = ppp_sync_room,
        .receive_buf = ppp_sync_receive,
        .write_wakeup = ppp_sync_wakeup,
 };