summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-01-06 13:45:43 +0000
committerderaadt <deraadt@openbsd.org>1996-01-06 13:45:43 +0000
commitee54014b3ce4d2d3843a65a56dd87dee9d4348a7 (patch)
treeacdd8b5f461c2d3137259ff36eab13fefeca6e35
parentby mrg and myself on irc: fix a ttymalloc() memory leak, TIOCM* botch (diff)
downloadwireguard-openbsd-ee54014b3ce4d2d3843a65a56dd87dee9d4348a7.tar.xz
wireguard-openbsd-ee54014b3ce4d2d3843a65a56dd87dee9d4348a7.zip
one tests code before one commits it. initialize ttymalloc'd struct properly.
also with mrg: use B1200 instead of 1200.
-rw-r--r--sys/arch/sparc/dev/zs.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c
index d8e50c1b397..c37e8f97041 100644
--- a/sys/arch/sparc/dev/zs.c
+++ b/sys/arch/sparc/dev/zs.c
@@ -279,13 +279,14 @@ zsattach(parent, dev, aux)
cs->cs_unit = unit;
cs->cs_speed = zs_getspeed(&addr->zs_chan[ZS_CHAN_A]);
cs->cs_zc = &addr->zs_chan[ZS_CHAN_A];
- tp->t_dev = makedev(ZSMAJOR, unit);
- tp->t_oproc = zsstart;
- tp->t_param = zsparam;
if ((ctp = zs_checkcons(sc, unit, cs)) != NULL)
tp = ctp;
- else
+ else {
tp = ttymalloc();
+ tp->t_dev = makedev(ZSMAJOR, unit);
+ tp->t_oproc = zsstart;
+ tp->t_param = zsparam;
+ }
cs->cs_ttyp = tp;
#ifdef KGDB
if (ctp == NULL)
@@ -311,13 +312,14 @@ zsattach(parent, dev, aux)
cs->cs_unit = unit;
cs->cs_speed = zs_getspeed(&addr->zs_chan[ZS_CHAN_B]);
cs->cs_zc = &addr->zs_chan[ZS_CHAN_B];
- tp->t_dev = makedev(ZSMAJOR, unit);
- tp->t_oproc = zsstart;
- tp->t_param = zsparam;
if ((ctp = zs_checkcons(sc, unit, cs)) != NULL)
tp = ctp;
- else
+ else {
tp = ttymalloc();
+ tp->t_dev = makedev(ZSMAJOR, unit);
+ tp->t_oproc = zsstart;
+ tp->t_param = zsparam;
+ }
cs->cs_ttyp = tp;
#ifdef KGDB
@@ -329,7 +331,7 @@ zsattach(parent, dev, aux)
/*
* Mouse: tell /dev/mouse driver how to talk to us.
*/
- tp->t_ispeed = tp->t_ospeed = 1200;
+ tp->t_ispeed = tp->t_ospeed = B1200;
tp->t_cflag = CS8;
ms_serial(tp, zsiopen, zsiclose);
ringsize = 128;