Showing error 757

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/gfs2/dir.c
Line in file: 987
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:22:22 UTC


Source:

 957                return 1; /* can't split */
 958        }
 959
 960        gfs2_trans_add_bh(dip->i_gl, obh, 1);
 961
 962        nleaf = new_leaf(inode, &nbh, be16_to_cpu(oleaf->lf_depth) + 1);
 963        if (!nleaf) {
 964                brelse(obh);
 965                return -ENOSPC;
 966        }
 967        bn = nbh->b_blocknr;
 968
 969        /*  Compute the start and len of leaf pointers in the hash table.  */
 970        len = 1 << (dip->i_depth - be16_to_cpu(oleaf->lf_depth));
 971        half_len = len >> 1;
 972        if (!half_len) {
 973                printk(KERN_WARNING "i_depth %u lf_depth %u index %u\n", dip->i_depth, be16_to_cpu(oleaf->lf_depth), index);
 974                gfs2_consist_inode(dip);
 975                error = -EIO;
 976                goto fail_brelse;
 977        }
 978
 979        start = (index & ~(len - 1));
 980
 981        /* Change the pointers.
 982           Don't bother distinguishing stuffed from non-stuffed.
 983           This code is complicated enough already. */
 984        lp = kmalloc(half_len * sizeof(__be64), GFP_NOFS | __GFP_NOFAIL);
 985        /*  Change the pointers  */
 986        for (x = 0; x < half_len; x++)
 987                lp[x] = cpu_to_be64(bn);
 988
 989        error = gfs2_dir_write_data(dip, (char *)lp, start * sizeof(u64),
 990                                    half_len * sizeof(u64));
 991        if (error != half_len * sizeof(u64)) {
 992                if (error >= 0)
 993                        error = -EIO;
 994                goto fail_lpfree;
 995        }
 996
 997        kfree(lp);
Show full sources