summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2010-07-22 04:59:32 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2010-07-22 04:59:32 +0000
commit157bebc453506b252856362372b7ef370be59b21 (patch)
treec4c7d6c3b8909248102b3ddd8efe0e86a48b528f /sys
parent64f848bfbc8f66d670df0076bf52532eaf21dda9 (diff)
In safte_match(), return 0 on SCSI errors, not an errno value. Fixes
regression from scsi_scsi_cmd() removal. ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/safte.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/scsi/safte.c b/sys/scsi/safte.c
index f2baaf66b62..14c17c03436 100644
--- a/sys/scsi/safte.c
+++ b/sys/scsi/safte.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safte.c,v 1.41 2010/07/22 00:31:06 krw Exp $ */
+/* $OpenBSD: safte.c,v 1.42 2010/07/22 04:59:31 matthew Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -141,7 +141,7 @@ safte_match(struct device *parent, void *match, void *aux)
flags |= SCSI_AUTOCONF;
xs = scsi_xs_get(sa->sa_sc_link, flags | SCSI_DATA_IN);
if (xs == NULL)
- return (ENOMEM);
+ return (0);
xs->cmd->opcode = INQUIRY;
xs->cmdlen = sizeof(*cmd);
xs->data = (void *)&inqbuf;
@@ -158,12 +158,13 @@ safte_match(struct device *parent, void *match, void *aux)
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
- if (error == 0) {
- if (memcmp(si->ident, SAFTE_IDENT, sizeof(si->ident)) == 0)
- return (2);
- }
+ if (error)
+ return (0);
- return (error);
+ if (memcmp(si->ident, SAFTE_IDENT, sizeof(si->ident)) == 0)
+ return (2);
+
+ return (0);
}
void