From: matthew Date: Thu, 22 Jul 2010 04:59:31 +0000 (+0000) Subject: In safte_match(), return 0 on SCSI errors, not an errno value. Fixes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=129b090604bd57ffab01b9fd59efa9f59128c2d4;p=openbsd In safte_match(), return 0 on SCSI errors, not an errno value. Fixes regression from scsi_scsi_cmd() removal. ok dlg@ --- 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