summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-04-08 17:02:02 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-08 17:02:02 (GMT)
commitd620a7cf05d4f12f5bbb1060d766e8139ab31458 (patch)
tree96123ef42b2c78b3c43fd46ea365e544353c6489
parent2aedd192f799c362ccefc3c316f0c4bd5154126b (diff)
parent45c4d015a92f72ec47acd0c7557abdc0c8a6499d (diff)
downloadlinux-fsl-qoriq-d620a7cf05d4f12f5bbb1060d766e8139ab31458.tar.xz
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2)
-rw-r--r--include/linux/ata.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index b4c85e2..700c5b9b 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -1025,8 +1025,8 @@ static inline int ata_ok(u8 status)
static inline int lba_28_ok(u64 block, u32 n_block)
{
- /* check the ending block number */
- return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256);
+ /* check the ending block number: must be LESS THAN 0x0fffffff */
+ return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256);
}
static inline int lba_48_ok(u64 block, u32 n_block)