Date: Sun, 14 Aug 2011 16:17:00 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r224868 - head/sys/dev/mmc Message-ID: <201108141617.p7EGH0Kd071083@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Aug 14 16:17:00 2011 New Revision: 224868 URL: http://svn.freebsd.org/changeset/base/224868 Log: Fix integer overflow on 32bit systems when calculating media size, reintroduced by r222475. Approved by: re (kib) Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Sun Aug 14 16:03:26 2011 (r224867) +++ head/sys/dev/mmc/mmcsd.c Sun Aug 14 16:17:00 2011 (r224868) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108141617.p7EGH0Kd071083>