summaryrefslogtreecommitdiffstats
path: root/sys/dev/mmc
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-08-14 16:17:00 +0000
committermav <mav@FreeBSD.org>2011-08-14 16:17:00 +0000
commitf05ee4368a00ea0456bb093923ed94e412c7a7a3 (patch)
treeb99591ac5f3f2ce6920b3106efff9e2b2a44390e /sys/dev/mmc
parentb739721734656bb1c52813b939216a1180496796 (diff)
downloadFreeBSD-src-f05ee4368a00ea0456bb093923ed94e412c7a7a3.zip
FreeBSD-src-f05ee4368a00ea0456bb093923ed94e412c7a7a3.tar.gz
Fix integer overflow on 32bit systems when calculating media size,
reintroduced by r222475. Approved by: re (kib)
Diffstat (limited to 'sys/dev/mmc')
-rw-r--r--sys/dev/mmc/mmcsd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c
index cbb64e4..6dd007c 100644
--- a/sys/dev/mmc/mmcsd.c
+++ b/sys/dev/mmc/mmcsd.c
@@ -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);
OpenPOWER on IntegriCloud