mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-27 16:39:08 +00:00
Fix potential panic by illegal increment of wfdnlun.
Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata) Reviewed by: Junichi Satoh <junichi@astec.co.jp> (the original author)
This commit is contained in:
parent
ed52f174ee
commit
ad940a43b0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52565
@ -192,7 +192,7 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
|
||||
bufq_init(&t->buf_queue);
|
||||
t->ata = ata;
|
||||
t->unit = unit;
|
||||
lun = t->lun = wfdnlun++;
|
||||
lun = t->lun = wfdnlun;
|
||||
t->param = ap;
|
||||
t->flags = F_MEDIA_CHANGED;
|
||||
t->refcnt = 0;
|
||||
@ -251,10 +251,11 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
|
||||
* Export the drive to the devstat interface.
|
||||
*/
|
||||
devstat_add_entry(&t->device_stats, "wfd",
|
||||
wfdnlun, t->cap.sector_size,
|
||||
t->lun, t->cap.sector_size,
|
||||
DEVSTAT_NO_ORDERED_TAGS,
|
||||
DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_IDE,
|
||||
DEVSTAT_PRIORITY_WFD);
|
||||
wfdnlun++;
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
|
||||
bufq_init(&t->buf_queue);
|
||||
t->ata = ata;
|
||||
t->unit = unit;
|
||||
lun = t->lun = wfdnlun++;
|
||||
lun = t->lun = wfdnlun;
|
||||
t->param = ap;
|
||||
t->flags = F_MEDIA_CHANGED;
|
||||
t->refcnt = 0;
|
||||
@ -251,10 +251,11 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
|
||||
* Export the drive to the devstat interface.
|
||||
*/
|
||||
devstat_add_entry(&t->device_stats, "wfd",
|
||||
wfdnlun, t->cap.sector_size,
|
||||
t->lun, t->cap.sector_size,
|
||||
DEVSTAT_NO_ORDERED_TAGS,
|
||||
DEVSTAT_TYPE_FLOPPY | DEVSTAT_TYPE_IF_IDE,
|
||||
DEVSTAT_PRIORITY_WFD);
|
||||
wfdnlun++;
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user