Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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)
  • Loading branch information
Linus Torvalds committed Apr 8, 2010
2 parents 2aedd19 + 45c4d01 commit d620a7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/ata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d620a7c

Please sign in to comment.