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
This commit is contained in:
parent
87888496cc
commit
262c8113c0
@ -285,7 +285,8 @@ passregister(struct cam_periph *periph, void *arg)
|
|||||||
* it even has a blocksize.
|
* it even has a blocksize.
|
||||||
*/
|
*/
|
||||||
no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0;
|
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
|
DEVSTAT_NO_BLOCKSIZE
|
||||||
| (no_tags ? DEVSTAT_NO_ORDERED_TAGS : 0),
|
| (no_tags ? DEVSTAT_NO_ORDERED_TAGS : 0),
|
||||||
softc->pd_type |
|
softc->pd_type |
|
||||||
@ -294,9 +295,9 @@ passregister(struct cam_periph *periph, void *arg)
|
|||||||
DEVSTAT_PRIORITY_PASS);
|
DEVSTAT_PRIORITY_PASS);
|
||||||
|
|
||||||
/* Register the device */
|
/* Register the device */
|
||||||
softc->dev = make_dev(&pass_cdevsw, periph->unit_number, UID_ROOT,
|
softc->dev = make_dev(&pass_cdevsw, unit2minor(periph->unit_number),
|
||||||
GID_OPERATOR, 0600, "%s%d", periph->periph_name,
|
UID_ROOT, GID_OPERATOR, 0600, "%s%d",
|
||||||
periph->unit_number);
|
periph->periph_name, periph->unit_number);
|
||||||
softc->dev->si_drv1 = periph;
|
softc->dev->si_drv1 = periph;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -363,7 +363,7 @@ sesregister(struct cam_periph *periph, void *arg)
|
|||||||
return (CAM_REQ_CMP_ERR);
|
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",
|
UID_ROOT, GID_OPERATOR, 0600, "%s%d",
|
||||||
periph->periph_name, periph->unit_number);
|
periph->periph_name, periph->unit_number);
|
||||||
softc->ses_dev->si_drv1 = periph;
|
softc->ses_dev->si_drv1 = periph;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user