From 78d1525a7a73df184d4394a1dcc1e95a1cd2542e Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 1 Dec 2021 17:04:26 +0000 Subject: [PATCH] late allocation of clist in putc() and b_to_q() hasn't been required in a decade, because all tty drivers preallocate. ok kettenis --- sys/kern/tty_subr.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 0f81ab61d72..c8bca080ddb 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.33 2016/03/14 23:08:06 krw Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.34 2021/12/01 17:04:26 deraadt Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -240,12 +240,8 @@ putc(int c, struct clist *clp) } if (clp->c_cc == 0) { - if (!clp->c_cs) { -#if defined(DIAGNOSTIC) - printf("putc: required clalloc\n"); -#endif - clalloc(clp, 1024, 1); - } + if (!clp->c_cs) + panic("%s: tty has no clist", __func__); clp->c_cf = clp->c_cl = clp->c_cs; } @@ -323,12 +319,8 @@ b_to_q(u_char *cp, int count, struct clist *clp) goto out; if (clp->c_cc == 0) { - if (!clp->c_cs) { -#if defined(DIAGNOSTIC) - printf("b_to_q: required clalloc\n"); -#endif - clalloc(clp, 1024, 1); - } + if (!clp->c_cs) + panic("%s: tty has no clist", __func__); clp->c_cf = clp->c_cl = clp->c_cs; } -- 2.20.1