From: Tim Gardner <tim.gardner@canonical.com>
To: linux-kernel@vger.kernel.org
Cc: Tim Gardner <tim.gardner@canonical.com>,
Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
ocfs2-devel@oss.oracle.com
Subject: [PATCH 1/2 linux-next] ocfs2: remove kfree() redundant null checks
Date: Wed, 13 Feb 2013 12:44:35 -0700 [thread overview]
Message-ID: <1360784676-74994-1-git-send-email-tim.gardner@canonical.com> (raw)
smatch analysis:
fs/ocfs2/alloc.c:6138 ocfs2_begin_truncate_log_recovery() info:
redundant null check on *tl_copy calling kfree()
fs/ocfs2/alloc.c:6755 ocfs2_zero_range_for_truncate() info:
redundant null check on pages calling kfree()
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel@oss.oracle.com
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
fs/ocfs2/alloc.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 31b9463..42c0e49 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -6134,11 +6134,8 @@ bail:
iput(tl_inode);
brelse(tl_bh);
- if (status < 0 && (*tl_copy)) {
- kfree(*tl_copy);
- *tl_copy = NULL;
- mlog_errno(status);
- }
+ kfree(*tl_copy);
+ *tl_copy = NULL;
return status;
}
@@ -6751,8 +6748,7 @@ int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle,
mlog_errno(ret);
out:
- if (pages)
- kfree(pages);
+ kfree(pages);
return ret;
}
--
1.7.9.5
next reply other threads:[~2013-02-13 19:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 19:44 Tim Gardner [this message]
2013-02-13 19:44 ` [PATCH 2/2 linux-next] ocfs2: ocfs2_begin_truncate_log_recovery(): consolidate status error logging Tim Gardner
2013-02-13 20:01 ` [PATCH 1/2 linux-next] ocfs2: remove kfree() redundant null checks Tim Gardner
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=1360784676-74994-1-git-send-email-tim.gardner@canonical.com \
--to=tim.gardner@canonical.com \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.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
all inboxes | Powered by JetHome®