In ngt_input(), do not derefer sc (= (sc_p) tp->t_lsc) before making
sure sc != NULL.
This commit is contained in:
parent
7f33c2df93
commit
314378233c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151085
@ -331,15 +331,18 @@ ngt_tioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread *td
|
||||
static int
|
||||
ngt_input(int c, struct tty *tp)
|
||||
{
|
||||
const sc_p sc = (sc_p) tp->t_lsc;
|
||||
const node_p node = sc->node;
|
||||
sc_p sc;
|
||||
node_p node;
|
||||
struct mbuf *m;
|
||||
int error = 0;
|
||||
|
||||
sc = (sc_p) tp->t_lsc;
|
||||
if (sc == NULL)
|
||||
/* No node attached */
|
||||
return (0);
|
||||
|
||||
node = sc->node;
|
||||
|
||||
if (tp != sc->tp)
|
||||
panic("ngt_input");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user