summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-12-05 19:53:05 +0000
committerkrw <krw@openbsd.org>2019-12-05 19:53:05 +0000
commit906b410b5abd06eb0c479dde6e9ab4dddacb7218 (patch)
treeee01c86004846c38aeb3cd0d5945942efe5890ad /sys/scsi/scsi_base.c
parentDocument IP6_SOIIKEY_LEN (diff)
downloadwireguard-openbsd-906b410b5abd06eb0c479dde6e9ab4dddacb7218.tar.xz
wireguard-openbsd-906b410b5abd06eb0c479dde6e9ab4dddacb7218.zip
Don't discard error from mode sense (6) if mode sense (10) is
not attempted.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 2b5d522bd6a..0c1f7592577 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.258 2019/12/05 18:42:14 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.259 2019/12/05 19:53:05 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -1256,7 +1256,7 @@ scsi_do_mode_sense(struct scsi_link *link, int pg_code,
union scsi_mode_sense_buf *buf, void **page_data,
int pg_length, int flags, int *big)
{
- int error;
+ int error = 0;
*page_data = NULL;
*big = 0;
@@ -1288,11 +1288,12 @@ scsi_do_mode_sense(struct scsi_link *link, int pg_code,
}
/*
- * non-ATAPI, non-USB devices that don't support SCSI-2 commands are done.
+ * non-ATAPI, non-USB devices that don't support SCSI-2 commands
+ * (i.e. MODE SENSE (10)) are done.
*/
if ((link->flags & (SDEV_ATAPI | SDEV_UMASS)) == 0 &&
SID_ANSII_REV(&link->inqdata) < SCSI_REV_2)
- return (0);
+ return error;
/*
* Try 10 byte mode sense request.