1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Fix integer overflow on 32bit systems when calculating media size,

reintroduced by r222475.

Approved by:	re (kib)
This commit is contained in:
Alexander Motin 2011-08-14 16:17:00 +00:00
parent 11f6a0164f
commit 1f89a4dc85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224868

View File

@ -137,7 +137,7 @@ mmcsd_attach(device_t dev)
d->d_drv1 = sc;
d->d_maxsize = 4*1024*1024; /* Maximum defined SD card AU size. */
d->d_sectorsize = mmc_get_sector_size(dev);
d->d_mediasize = mmc_get_media_size(dev) * d->d_sectorsize;
d->d_mediasize = (off_t)mmc_get_media_size(dev) * d->d_sectorsize;
d->d_stripeoffset = 0;
d->d_stripesize = mmc_get_erase_sector(dev) * d->d_sectorsize;
d->d_unit = device_get_unit(dev);