diff options
author | Dima Dorfman <dd@FreeBSD.org> | 2001-11-24 15:59:46 +0000 |
---|---|---|
committer | Dima Dorfman <dd@FreeBSD.org> | 2001-11-24 15:59:46 +0000 |
commit | 2c1a6f2178f0931b6ccce34bccf4fd3f54bdce44 (patch) | |
tree | 9b523f22cda1ff6a503ead39130f7184af34e801 /sys/dev/snp | |
parent | 3278021b9458da12647e22c16568204ffaf098e1 (diff) | |
download | src-2c1a6f2178f0931b6ccce34bccf4fd3f54bdce44.tar.gz src-2c1a6f2178f0931b6ccce34bccf4fd3f54bdce44.zip |
Check the return value of tsleep() in snpread(). This may be
important, since our sleep is interruptable (PCATCH flag).
PR: 30985
Discovered by: Vladimir Jakovenko <vovik@lucky.net>
Submitted by: Valentin Nechayev <netch@segfault.kiev.ua>
Notes
Notes:
svn path=/head/; revision=86861
Diffstat (limited to 'sys/dev/snp')
-rw-r--r-- | sys/dev/snp/snp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index 0b4504703d67..8c900d88a819 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -256,7 +256,10 @@ snpread(dev, uio, flag) if (flag & IO_NDELAY) return (EWOULDBLOCK); snp->snp_flags |= SNOOP_RWAIT; - tsleep((caddr_t)snp, (PZERO + 1) | PCATCH, "snprd", 0); + error = tsleep((caddr_t)snp, (PZERO + 1) | PCATCH, + "snprd", 0); + if (error != 0) + return (error); } } while (snp->snp_len == 0); |