diff options
Diffstat (limited to 'usr/src/uts/common/os/streamio.c')
-rw-r--r-- | usr/src/uts/common/os/streamio.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c index 18a5ded1c6..62f94729cf 100644 --- a/usr/src/uts/common/os/streamio.c +++ b/usr/src/uts/common/os/streamio.c @@ -8218,7 +8218,11 @@ strpoll( tq = qp->q_next->q_nfsrv; ASSERT(tq != NULL); - polllock(&stp->sd_pollist, QLOCK(tq)); + if (polllock(&stp->sd_pollist, QLOCK(tq)) != 0) { + releasestr(qp); + *reventsp = POLLNVAL; + return (0); + } if (events & POLLWRNORM) { queue_t *sqp; @@ -8228,7 +8232,12 @@ strpoll( else if ((sqp = stp->sd_struiowrq) != NULL) { /* Check sync stream barrier write q */ mutex_exit(QLOCK(tq)); - polllock(&stp->sd_pollist, QLOCK(sqp)); + if (polllock(&stp->sd_pollist, + QLOCK(sqp)) != 0) { + releasestr(qp); + *reventsp = POLLNVAL; + return (0); + } if (sqp->q_flag & QFULL) /* ensure pollwakeup() is done */ sqp->q_flag |= QWANTWSYNC; @@ -8241,7 +8250,12 @@ strpoll( goto chkrd; } mutex_exit(QLOCK(sqp)); - polllock(&stp->sd_pollist, QLOCK(tq)); + if (polllock(&stp->sd_pollist, + QLOCK(tq)) != 0) { + releasestr(qp); + *reventsp = POLLNVAL; + return (0); + } } else retevents |= POLLOUT; } @@ -8273,7 +8287,10 @@ chkrd: * Note: Need to do polllock() here since ps_lock may be * held. See bug 4191544. */ - polllock(&stp->sd_pollist, &stp->sd_lock); + if (polllock(&stp->sd_pollist, &stp->sd_lock) != 0) { + *reventsp = POLLNVAL; + return (0); + } headlocked = 1; mp = qp->q_first; while (mp) { @@ -8326,7 +8343,10 @@ chkrd: if (!anyyet) { *phpp = &stp->sd_pollist; if (headlocked == 0) { - polllock(&stp->sd_pollist, &stp->sd_lock); + if (polllock(&stp->sd_pollist, &stp->sd_lock) != 0) { + *reventsp = POLLNVAL; + return (0); + } headlocked = 1; } stp->sd_rput_opt |= SR_POLLIN; |