cam: fix sign-extension error in adagetparams
adagetparams contains a sign-extension error that will cause the sector count to be incorrectly calculated for ATA disks of >=1TiB that still use CHS addressing. Disks using LBA48 addressing are unaffected. Reported by: Coverity CID: 1007296 Reviewed by: ken MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13198
This commit is contained in:
parent
c0a8dfea7f
commit
99ae1d3b25
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326624
@ -3377,7 +3377,8 @@ adagetparams(struct cam_periph *periph, struct ccb_getdev *cgd)
|
||||
dp->heads = cgd->ident_data.heads;
|
||||
dp->secs_per_track = cgd->ident_data.sectors;
|
||||
dp->cylinders = cgd->ident_data.cylinders;
|
||||
dp->sectors = cgd->ident_data.cylinders * dp->heads * dp->secs_per_track;
|
||||
dp->sectors = cgd->ident_data.cylinders *
|
||||
(u_int32_t)(dp->heads * dp->secs_per_track);
|
||||
}
|
||||
lbasize = (u_int32_t)cgd->ident_data.lba_size_1 |
|
||||
((u_int32_t)cgd->ident_data.lba_size_2 << 16);
|
||||
|
Loading…
Reference in New Issue
Block a user