aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-07-17 12:40:01 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-07-17 12:40:01 -0700
commit9c2baed55c657e68b5d2aa7de7557eccfc74eb6b (patch)
treeaddecbba0805d9e417ae8a3608571a91f9779ce3
parent8cca6fd29bb7613f5ba6acb1b740d13f5b6ac01d (diff)
downloadhdt-pierre-9c2baed55c657e68b5d2aa7de7557eccfc74eb6b.tar.gz
hdt-pierre-9c2baed55c657e68b5d2aa7de7557eccfc74eb6b.tar.xz
hdt-pierre-9c2baed55c657e68b5d2aa7de7557eccfc74eb6b.zip
diskio: add a paranoia cast
Make sure we don't overflow the shift, even though that should never be possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/fs/diskio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index 449e12c4..481b59b0 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -12,7 +12,7 @@
static inline sector_t chs_max(const struct disk *disk)
{
- return disk->secpercyl << 10;
+ return (sector_t)disk->secpercyl << 10;
}
static int chs_rdwr_sectors(struct disk *disk, void *buf,