Showing error 1671

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/xfs/xfs_inode.c
Line in file: 4352
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 07:54:05 UTC


Source:

4322        }
4323        *idxp = page_idx;
4324        *erp_idxp = erp_idx;
4325        return(erp);
4326}
4327
4328/*
4329 * Allocate and initialize an indirection array once the space needed
4330 * for incore extents increases above XFS_IEXT_BUFSZ.
4331 */
4332void
4333xfs_iext_irec_init(
4334        xfs_ifork_t        *ifp)                /* inode fork pointer */
4335{
4336        xfs_ext_irec_t        *erp;                /* indirection array pointer */
4337        xfs_extnum_t        nextents;        /* number of extents in file */
4338
4339        ASSERT(!(ifp->if_flags & XFS_IFEXTIREC));
4340        nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
4341        ASSERT(nextents <= XFS_LINEAR_EXTS);
4342
4343        erp = kmem_alloc(sizeof(xfs_ext_irec_t), KM_NOFS);
4344
4345        if (nextents == 0) {
4346                ifp->if_u1.if_extents = kmem_alloc(XFS_IEXT_BUFSZ, KM_NOFS);
4347        } else if (!ifp->if_real_bytes) {
4348                xfs_iext_inline_to_direct(ifp, XFS_IEXT_BUFSZ);
4349        } else if (ifp->if_real_bytes < XFS_IEXT_BUFSZ) {
4350                xfs_iext_realloc_direct(ifp, XFS_IEXT_BUFSZ);
4351        }
4352        erp->er_extbuf = ifp->if_u1.if_extents;
4353        erp->er_extcount = nextents;
4354        erp->er_extoff = 0;
4355
4356        ifp->if_flags |= XFS_IFEXTIREC;
4357        ifp->if_real_bytes = XFS_IEXT_BUFSZ;
4358        ifp->if_bytes = nextents * sizeof(xfs_bmbt_rec_t);
4359        ifp->if_u1.if_ext_irec = erp;
4360
4361        return;
4362}
Show full sources