diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-12-05 19:53:06 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-12-05 19:53:06 +0000 |
commit | 0c8438831b8b9593237110e54d1f7ba875b66b36 (patch) | |
tree | 1508afb30f4607ce1dfebbae9a54494548ece21c /sys | |
parent | cd1320b06d6b3e4f9a71289c698506361c53e7e8 (diff) |
Don't discard error from mode sense (6) if mode sense (10) is
not attempted.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/scsi_base.c | 9 |
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. |