diff options
author | apersson <none@none> | 2008-06-06 15:29:20 -0700 |
---|---|---|
committer | apersson <none@none> | 2008-06-06 15:29:20 -0700 |
commit | 25cfde9ce623f31c57891c6d61fc4d43a7f5d7de (patch) | |
tree | ab57748e6fac4b2be4b170b410e8bfbf97b4bcf0 /usr/src | |
parent | ae5b046d8f8cec187d40041c4b74b43f561d5ac7 (diff) | |
download | illumos-joyent-25cfde9ce623f31c57891c6d61fc4d43a7f5d7de.tar.gz |
6708602 closing a SDP socket panics system that do not have IB hardware
Diffstat (limited to 'usr/src')
-rwxr-xr-x | usr/src/uts/common/fs/sockfs/socksdpvnops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/sockfs/socksdpvnops.c b/usr/src/uts/common/fs/sockfs/socksdpvnops.c index 0993bff6a4..76de32e406 100755 --- a/usr/src/uts/common/fs/sockfs/socksdpvnops.c +++ b/usr/src/uts/common/fs/sockfs/socksdpvnops.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -107,7 +107,7 @@ socksdpv_open(struct vnode **vpp, int flag, struct cred *cr, struct sonode *so; struct sdp_sonode *ss; struct vnode *vp = *vpp; - int error = 0; + int error = EPROTONOSUPPORT; /* in case sdpib fails to load */ sdp_sockbuf_limits_t sbl; sdp_upcalls_t *upcalls; @@ -133,9 +133,16 @@ socksdpv_open(struct vnode **vpp, int flag, struct cred *cr, */ upcalls = &sosdp_sock_upcalls; + /* + * When the necessary hardware is not available, the sdp_create stub + * will evaluate to nomod_zero, which leaves 'error' untouched. Hence + * the EPROTONOSUPPORT above. A successful call to sdp_create clears + * the error. + */ so->so_priv = sdp_create(ss, NULL, so->so_family, SDP_CAN_BLOCK, upcalls, &sbl, cr, &error); if (so->so_priv == NULL) { + ASSERT(error != 0); mutex_enter(&so->so_lock); ASSERT(so->so_count > 0); so->so_count--; /* one less open reference */ |