From 157bebc453506b252856362372b7ef370be59b21 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 22 Jul 2010 04:59:32 +0000 Subject: In safte_match(), return 0 on SCSI errors, not an errno value. Fixes regression from scsi_scsi_cmd() removal. ok dlg@ --- sys/scsi/safte.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sys/scsi/safte.c') 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 @@ -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 -- cgit v1.2.3