From a3b953a8252b389423d9b148b54178584bacc880 Mon Sep 17 00:00:00 2001 From: njl Date: Mon, 22 Sep 2003 04:59:07 +0000 Subject: 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 --- sys/dev/ips/ips_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/ips') 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", -- cgit v1.1