X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fppp_async.c;h=27f5b904f48ec403f2008a27a1e292f98a8d211f;hb=feb24691e3e87a740caec4568be1a202db786f20;hp=23659fd7c3a6bc120c5149eeb4a832e28a8c75b3;hpb=2e9abdd9bad485970b37cd53a82f92702054984c;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 23659fd7c3a..27f5b904f48 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c @@ -125,8 +125,8 @@ static struct ppp_channel_ops async_ops = { * way to fix this is to use a rwlock in the tty struct, but for now * we use a single global rwlock for all ttys in ppp line discipline. * - * FIXME: this is no longer true. The _close path for the ldisc is - * now guaranteed to be sane. + * FIXME: this is no longer true. The _close path for the ldisc is + * now guaranteed to be sane. */ static DEFINE_RWLOCK(disc_data_lock); @@ -159,12 +159,11 @@ ppp_asynctty_open(struct tty_struct *tty) int err; err = -ENOMEM; - ap = kmalloc(sizeof(*ap), GFP_KERNEL); + ap = kzalloc(sizeof(*ap), GFP_KERNEL); if (ap == 0) goto out; /* initialize the asyncppp structure */ - memset(ap, 0, sizeof(*ap)); ap->tty = tty; ap->mru = PPP_MRU; spin_lock_init(&ap->xmit_lock); @@ -277,7 +276,7 @@ ppp_asynctty_write(struct tty_struct *tty, struct file *file, * Called in process context only. May be re-entered by multiple * ioctl calling threads. */ - + static int ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) @@ -802,9 +801,9 @@ process_input_packet(struct asyncppp *ap) /* check for address/control and protocol compression */ p = skb->data; - if (p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { + if (p[0] == PPP_ALLSTATIONS) { /* chop off address/control */ - if (skb->len < 3) + if (p[1] != PPP_UI || skb->len < 3) goto err; p = skb_pull(skb, 2); }