From: Dan Carpenter <dan.carpenter@oracle.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>,
Tao Peng <bergwolf@primarydata.com>,
Weston Andros Adamson <dros@primarydata.com>,
Tom Haynes <loghyr@primarydata.com>,
linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] pnfs/flexfiles: move kfree() after the deference
Date: Wed, 11 Feb 2015 10:22:40 +0000 [thread overview]
Message-ID: <20150211102240.GA18515@mwanda> (raw)
We dereference "err" in the the debug printk so we have to move the
kfree() down a couple lines.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 3bbb16b..e2c01f2 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -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;
next reply other threads:[~2015-02-11 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 10:22 Dan Carpenter [this message]
2015-02-11 12:55 ` [patch] pnfs/flexfiles: move kfree() after the deference Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150211102240.GA18515@mwanda \
--to=dan.carpenter@oracle.com \
--cc=anna.schumaker@netapp.com \
--cc=bergwolf@primarydata.com \
--cc=dros@primarydata.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=loghyr@primarydata.com \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox