diff options
author | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-06-09 00:58:04 +0000 |
---|---|---|
committer | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-06-09 00:58:04 +0000 |
commit | 0223f72a41de28a17fbf02be5f5146f1e6078030 (patch) | |
tree | 3dfc2433acaa7c23f81153ea58c458264e3c25ca /sys/dev | |
parent | 9b595a1c79d0f7973697268ef5e098588ae57953 (diff) |
Handle out of memory gracefully. ok miod@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/pckbc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index b67e61a8362..deb5ba7b042 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.4 2002/04/30 20:56:15 miod Exp $ */ +/* $OpenBSD: pckbc.c,v 1.5 2002/06/09 00:58:03 nordin Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -284,6 +284,8 @@ pckbc_attach_slot(sc, slot) if (found && !t->t_slotdata[slot]) { t->t_slotdata[slot] = malloc(sizeof(struct pckbc_slotdata), M_DEVBUF, M_NOWAIT); + if (t->t_slotdata[slot] == NULL) + return 0; pckbc_init_slotdata(t->t_slotdata[slot]); } return (found); |