diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-01-03 00:16:07 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-01-03 00:16:07 +0000 |
commit | c146b8722acabc9cdd5c98b3179825d1bc99a3f6 (patch) | |
tree | 6a0200bba87da45b744fab4aabb53f1542762ebb /sys | |
parent | 90a64b80c5e7816f81ca4cacbd00097d4056a150 (diff) | |
download | FreeBSD-src-c146b8722acabc9cdd5c98b3179825d1bc99a3f6.zip FreeBSD-src-c146b8722acabc9cdd5c98b3179825d1bc99a3f6.tar.gz |
If MALLOC() fails in at_pcballoc(), return ENOBUFS rather than
potentially panicking.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netatalk/ddp_pcb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netatalk/ddp_pcb.c b/sys/netatalk/ddp_pcb.c index dd69850..dda2cb7 100644 --- a/sys/netatalk/ddp_pcb.c +++ b/sys/netatalk/ddp_pcb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Robert N. M. Watson + * Copyright (c) 2004-2005 Robert N. M. Watson * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * @@ -254,6 +254,8 @@ at_pcballoc(struct socket *so) DDP_LIST_XLOCK_ASSERT(); MALLOC(ddp, struct ddpcb *, sizeof *ddp, M_PCB, M_NOWAIT | M_ZERO); + if (ddp == NULL) + return (ENOBUFS); DDP_LOCK_INIT(ddp); ddp->ddp_lsat.sat_port = ATADDR_ANYPORT; |