提交 d620a7cf 编写于 作者: L Linus Torvalds

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)
...@@ -1025,8 +1025,8 @@ static inline int ata_ok(u8 status) ...@@ -1025,8 +1025,8 @@ static inline int ata_ok(u8 status)
static inline int lba_28_ok(u64 block, u32 n_block) static inline int lba_28_ok(u64 block, u32 n_block)
{ {
/* check the ending block number */ /* check the ending block number: must be LESS THAN 0x0fffffff */
return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256);
} }
static inline int lba_48_ok(u64 block, u32 n_block) static inline int lba_48_ok(u64 block, u32 n_block)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册