summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2005-01-22 07:21:25 +0000
committermjacob <mjacob@FreeBSD.org>2005-01-22 07:21:25 +0000
commit262c8113c07ada6d90014bece09a7fb3858ee085 (patch)
treea49fe1b52db0d1b42244e6641d2f4ee228a9f0f2 /sys/cam
parent87888496cc9e2d5e2e57e2f77d2fa7f615a0e1ed (diff)
downloadFreeBSD-src-262c8113c07ada6d90014bece09a7fb3858ee085.zip
FreeBSD-src-262c8113c07ada6d90014bece09a7fb3858ee085.tar.gz
Don't pass unadulterated unit numbers to make_dev and its ilk- if you
have more than 256 units, you die. Horribly. Convert them using unit2minor. MFC after: 1 week
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_pass.c9
-rw-r--r--sys/cam/scsi/scsi_ses.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index a25a9d8..774daee 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -285,7 +285,8 @@ passregister(struct cam_periph *periph, void *arg)
* it even has a blocksize.
*/
no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0;
- softc->device_stats = devstat_new_entry("pass", periph->unit_number, 0,
+ softc->device_stats = devstat_new_entry("pass",
+ unit2minor(periph->unit_number), 0,
DEVSTAT_NO_BLOCKSIZE
| (no_tags ? DEVSTAT_NO_ORDERED_TAGS : 0),
softc->pd_type |
@@ -294,9 +295,9 @@ passregister(struct cam_periph *periph, void *arg)
DEVSTAT_PRIORITY_PASS);
/* Register the device */
- softc->dev = make_dev(&pass_cdevsw, periph->unit_number, UID_ROOT,
- GID_OPERATOR, 0600, "%s%d", periph->periph_name,
- periph->unit_number);
+ softc->dev = make_dev(&pass_cdevsw, unit2minor(periph->unit_number),
+ UID_ROOT, GID_OPERATOR, 0600, "%s%d",
+ periph->periph_name, periph->unit_number);
softc->dev->si_drv1 = periph;
/*
diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c
index 0c8c2a9..a25fd90 100644
--- a/sys/cam/scsi/scsi_ses.c
+++ b/sys/cam/scsi/scsi_ses.c
@@ -363,7 +363,7 @@ sesregister(struct cam_periph *periph, void *arg)
return (CAM_REQ_CMP_ERR);
}
- softc->ses_dev = make_dev(&ses_cdevsw, periph->unit_number,
+ softc->ses_dev = make_dev(&ses_cdevsw, unit2minor(periph->unit_number),
UID_ROOT, GID_OPERATOR, 0600, "%s%d",
periph->periph_name, periph->unit_number);
softc->ses_dev->si_drv1 = periph;
OpenPOWER on IntegriCloud