diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index cb3cda1390ad..8dba15c83a49 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -2142,6 +2142,11 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno, int size; s8 *leaf; + if(blkno >= le64_to_cpu(bmp->db_mapsize)) { + jfs_error(bmp->db_ipbmap->i_sb, "Allocation request out of bounds\n"); + return; + } + /* pick up a pointer to the leaves of the dmap tree */ leaf = dp->tree.stree + LEAFIND;