summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-08-01 22:42:51 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-08-01 22:42:51 +0000
commit364f7ed676af1615fc5a695e290e9796e2673a98 (patch)
treebca489875b25f1e718023036e89d3526b2a73abc /sys
parent2f8e0c42321161f5865bf8df2c542f7d9c45e174 (diff)
Return 0 as the block size when READ_CAPACITY fails in scsi_size().
Prevents garbage being used as ssblksize in sd_get_parms(). Perhaps another nail in the coffin for PR4313.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_base.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 051e46d9e74..d02a42b9191 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.85 2005/06/23 00:31:44 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.86 2005/08/01 22:42:50 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -228,6 +228,9 @@ scsi_size(sc_link, flags, blksize)
struct scsi_read_cap_data rdcap;
u_long max_addr;
+ if (blksize)
+ *blksize = 0;
+
/*
* make up a scsi command and ask the scsi driver to do
* it for you.