summaryrefslogtreecommitdiffstats
path: root/sys/dev/ips
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-09-22 04:59:07 +0000
committernjl <njl@FreeBSD.org>2003-09-22 04:59:07 +0000
commita3b953a8252b389423d9b148b54178584bacc880 (patch)
tree2e1b79392657dd87d047ecd3494e6d219ecb1ec4 /sys/dev/ips
parent9c61d652666c129c04eed45e1ae38f886f8f519a (diff)
downloadFreeBSD-src-a3b953a8252b389423d9b148b54178584bacc880.zip
FreeBSD-src-a3b953a8252b389423d9b148b54178584bacc880.tar.gz
Add an off_t cast to prevent overflow on media size. This should
fix issues with geometry not matching drive size. Submitted by: Clive Lin <clive@tongi.org>
Diffstat (limited to 'sys/dev/ips')
-rw-r--r--sys/dev/ips/ips_disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ips/ips_disk.c b/sys/dev/ips/ips_disk.c
index 7b073b7..cde0545 100644
--- a/sys/dev/ips/ips_disk.c
+++ b/sys/dev/ips/ips_disk.c
@@ -139,7 +139,7 @@ static int ipsd_attach(device_t dev)
dsc->ipsd_disk.d_fwsectors = IPS_COMP_SECTORS;
}
dsc->ipsd_disk.d_sectorsize = IPS_BLKSIZE;
- dsc->ipsd_disk.d_mediasize = totalsectors * IPS_BLKSIZE;
+ dsc->ipsd_disk.d_mediasize = (off_t)totalsectors * IPS_BLKSIZE;
disk_create(dsc->unit, &dsc->ipsd_disk, 0, NULL, NULL);
device_printf(dev, "Logical Drive (%dMB)\n",
OpenPOWER on IntegriCloud