diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c index 2d304cee884c..90cbf380ee51 100644 --- a/fs/jfs/jfs_xtree.c +++ b/fs/jfs/jfs_xtree.c @@ -619,6 +619,9 @@ int xtInsert(tid_t tid, /* transaction id */ (nextindex - index) * sizeof(xad_t)); /* insert the new entry: mark the entry NEW */ + if (index >= XTROOTMAXSLOT) + rc = -EINVAL; + goto out; xad = &p->xad[index]; XT_PUTENTRY(xad, xflag, xoff, xlen, xaddr); @@ -2914,3 +2917,4 @@ int jfs_xtstat_proc_show(struct seq_file *m, void *v) return 0; } #endif +