X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fppp_synctty.c;h=d2fa2db1358633771439013546758654444c6a00;hb=b63a2cb30405777033d58045c562a3b04d87d702;hp=801d8f99d4714155e2f3b3f9c0879ec15d2de8ba;hpb=af7a535688a758d15f06a98833e6a143b29af9de;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index 801d8f99d47..d2fa2db1358 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c @@ -206,6 +206,7 @@ ppp_sync_open(struct tty_struct *tty) { struct syncppp *ap; int err; + int speed; if (tty->ops->write == NULL) return -EOPNOTSUPP; @@ -234,6 +235,8 @@ ppp_sync_open(struct tty_struct *tty) ap->chan.ops = &sync_ops; ap->chan.mtu = PPP_MRU; ap->chan.hdrlen = 2; /* for A/C bytes */ + speed = tty_get_baud_rate(tty); + ap->chan.speed = speed; err = ppp_register_channel(&ap->chan); if (err) goto out_free; @@ -281,8 +284,7 @@ ppp_sync_close(struct tty_struct *tty) ppp_unregister_channel(&ap->chan); skb_queue_purge(&ap->rqueue); - if (ap->tpkt) - kfree_skb(ap->tpkt); + kfree_skb(ap->tpkt); kfree(ap); } @@ -333,9 +335,6 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, err = -EFAULT; switch (cmd) { case PPPIOCGCHAN: - err = -ENXIO; - if (!ap) - break; err = -EFAULT; if (put_user(ppp_channel_index(&ap->chan), p)) break; @@ -343,9 +342,6 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, break; case PPPIOCGUNIT: - err = -ENXIO; - if (!ap) - break; err = -EFAULT; if (put_user(ppp_unit_number(&ap->chan), p)) break;