Sachin Kamat
2013-Apr-26 11:00 UTC
[Ocfs2-devel] [PATCH 1/1] ocfs2/dlm: Remove redundant null pointer check
kfree on a NULL pointer is a no-op. Hence remove the redundant null pointer check. Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org> --- fs/ocfs2/dlm/dlmrecovery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index ba1e689..5f9e476 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -1498,10 +1498,8 @@ leave: dlm_put(dlm); if (ret < 0) { - if (buf) - kfree(buf); - if (item) - kfree(item); + kfree(buf); + kfree(item); mlog_errno(ret); } -- 1.7.9.5
Mark Fasheh
2013-Apr-26 17:51 UTC
[Ocfs2-devel] [PATCH 1/1] ocfs2/dlm: Remove redundant null pointer check
This seems entirely reasonable. On Fri, Apr 26, 2013 at 04:17:42PM +0530, Sachin Kamat wrote:> kfree on a NULL pointer is a no-op. Hence remove the redundant null > pointer check. > > Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>Signed-off-by: Mark Fasheh <mfasheh at suse.de> --Mark -- Mark Fasheh