pnfs/flexfiles: Do not dprintk after the free
authorTom Haynes <thomas.haynes@primarydata.com>
Tue, 10 Feb 2015 01:48:32 +0000 (17:48 -0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 10 Feb 2015 03:34:29 +0000 (22:34 -0500)
Found by 0-DAY kernel test infrastructure:

fs/nfs/flexfilelayout/flexfilelayoutdev.c:520:13-16: ERROR: reference preceded by free on line 518
fs/nfs/flexfilelayout/flexfilelayoutdev.c:520:26-29: ERROR: reference preceded by free on line 518
fs/nfs/flexfilelayout/flexfilelayoutdev.c:520:39-42: ERROR: reference preceded by free on line 518
fs/nfs/flexfilelayout/flexfilelayoutdev.c:521:3-6: ERROR: reference preceded by free on line 518

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/flexfilelayout/flexfilelayoutdev.c

index 3bbb16b..e2c01f2 100644 (file)
@@ -515,10 +515,10 @@ int ff_layout_encode_ds_ioerr(struct nfs4_flexfile_layout *flo,
                *p++ = cpu_to_be32(err->opnum);
                *count += 1;
                list_del(&err->list);
-               kfree(err);
                dprintk("%s: offset %llu length %llu status %d op %d count %d\n",
                        __func__, err->offset, err->length, err->status,
                        err->opnum, *count);
+               kfree(err);
        }
 
        return 0;