summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-12-01 15:41:43 +0000
committerkrw <krw@openbsd.org>2019-12-01 15:41:43 +0000
commit050be8af7e42b88aa116d4969a0aa14efbe3504c (patch)
tree36becb5af724ad86567287df5758c1883882123d
parentAllow forcing specific domains to be resolved by specific resolvers; (diff)
downloadwireguard-openbsd-050be8af7e42b88aa116d4969a0aa14efbe3504c.tar.xz
wireguard-openbsd-050be8af7e42b88aa116d4969a0aa14efbe3504c.zip
Don't overwrite original error returned by scsi_do_mode_sense().
-rw-r--r--sys/scsi/ch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c
index a43347a6c89..856a0a13714 100644
--- a/sys/scsi/ch.c
+++ b/sys/scsi/ch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ch.c,v 1.61 2019/11/29 14:06:21 krw Exp $ */
+/* $OpenBSD: ch.c,v 1.62 2019/12/01 15:41:43 krw Exp $ */
/* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */
/*
@@ -701,7 +701,7 @@ ch_get_params(struct ch_softc *sc, int flags)
*/
error = scsi_do_mode_sense(sc->sc_link, CAP_PAGE, data,
(void **)&cap, NULL, NULL, NULL, sizeof(*cap), flags, &big);
- if (cap == NULL)
+ if (error == 0 && cap == NULL)
error = EIO;
if (error != 0) {
#ifdef CHANGER_DEBUG