Fix previous change: don't attempt to reserve cblocks if the tty is null.

This commit is contained in:
Bruce Evans 1994-11-27 15:29:57 +00:00
parent 0e01a1ca15
commit 7b9754ed1f
2 changed files with 16 additions and 10 deletions

View File

@ -69,7 +69,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
/* $Id: if_ppp.c,v 1.7 1994/11/23 08:29:44 ugen Exp $ */
/* $Id: if_ppp.c,v 1.8 1994/11/26 19:23:59 bde Exp $ */
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
#include "ppp.h"
@ -1506,11 +1506,14 @@ pppioctl(ifp, cmd, data)
if (error = suser(p->p_ucred, &p->p_acflag))
return (error);
if (ifr->ifr_mtu > PPP_MAXMTU)
error = EINVAL;
error = EINVAL;
else {
sc->sc_if.if_mtu = ifr->ifr_mtu;
clist_alloc_cblocks(&((struct tty *) sc->sc_devp)->t_outq,
sc->sc_if.if_mtu + PPP_HIWAT,
struct tty *tp;
sc->sc_if.if_mtu = ifr->ifr_mtu;
tp = (struct tty *) sc->sc_devp;
if (tp != NULL)
clist_alloc_cblocks(&tp->t_outq, sc->sc_if.if_mtu + PPP_HIWAT,
sc->sc_if.if_mtu + PPP_HIWAT);
}
break;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_sl.c 8.6 (Berkeley) 2/1/94
* $Id: if_sl.c,v 1.9 1994/10/08 01:40:22 phk Exp $
* $Id: if_sl.c,v 1.10 1994/11/26 19:24:00 bde Exp $
*/
/*
@ -883,11 +883,14 @@ slioctl(ifp, cmd, data)
if (ifr->ifr_mtu > SLTMAX)
error = EINVAL;
else {
struct tty *tp;
ifp->if_mtu = ifr->ifr_mtu;
clist_alloc_cblocks(
&sl_softc[ifp->if_unit].sc_ttyp->t_outq,
ifp->if_mtu + SLIP_HIWAT,
ifp->if_mtu + SLIP_HIWAT);
tp = sl_softc[ifp->if_unit].sc_ttyp;
if (tp != NULL)
clist_alloc_cblocks(&tp->t_outq,
ifp->if_mtu + SLIP_HIWAT,
ifp->if_mtu + SLIP_HIWAT);
}
break;