-/* $OpenBSD: scsiconf.c,v 1.246 2022/03/22 16:29:58 krw Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.247 2022/03/23 14:36:01 krw Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
SC_DEBUG(link, SDEV_DB2, ("dev_probe(link) failed.\n"));
rslt = EINVAL;
}
- goto free;
+ free(link, M_DEVBUF, sizeof(*link));
+ return rslt;
}
/*
/* The device doesn't distinguish between LUNs. */
SC_DEBUG(link, SDEV_DB1, ("IDENTIFY not supported.\n"));
rslt = EINVAL;
- goto free_devid;
+ goto bad;
}
link->quirks = devquirks; /* Restore what the device wanted. */
if (cf == NULL) {
scsibussubprint(&sa, sb->sc_dev.dv_xname);
printf(" not configured\n");
- goto free_devid;
+ goto bad;
}
/*
config_attach((struct device *)sb, cf, &sa, scsibussubprint);
return 0;
-free_devid:
- if (link->id)
- devid_free(link->id);
bad:
- if (ISSET(link->flags, SDEV_OWN_IOPL))
- free(link->pool, M_DEVBUF, sizeof(*link->pool));
-
- if (sb->sb_adapter->dev_free != NULL)
- sb->sb_adapter->dev_free(link);
-free:
- free(link, M_DEVBUF, sizeof(*link));
+ scsi_detach_link(link, DETACH_FORCE);
return rslt;
}