From: "Jiejing.Zhang" Subject: [PATCH 1/2] autofs4: redundant null check on kfree() Date: Thu, 12 Aug 2010 01:12:18 +0800 Message-ID: <1281546739-3616-1-git-send-email-kzjeef@gmail.com> Cc: "JieJing.Zhang" To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:44939 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537Ab0HKRNZ (ORCPT ); Wed, 11 Aug 2010 13:13:25 -0400 Received: by fxm13 with SMTP id 13so281533fxm.19 for ; Wed, 11 Aug 2010 10:13:24 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: JieJing.Zhang Signed-off-by: JieJing.Zhang --- fs/autofs4/inode.c | 6 ++---- fs/autofs4/waitq.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 821b2b9..4e394ef 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c @@ -24,10 +24,8 @@ static void ino_lnkfree(struct autofs_info *ino) { - if (ino->u.symlink) { - kfree(ino->u.symlink); - ino->u.symlink = NULL; - } + kfree(ino->u.symlink); + ino->u.symlink = NULL; } struct autofs_info *autofs4_init_ino(struct autofs_info *ino, diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 2341375..cff98b0 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c @@ -42,10 +42,8 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi) while (wq) { nwq = wq->next; wq->status = -ENOENT; /* Magic is gone - report failure */ - if (wq->name.name) { - kfree(wq->name.name); - wq->name.name = NULL; - } + kfree(wq->name.name); + wq->name.name = NULL; wq->wait_ctr--; wake_up_interruptible(&wq->queue); wq = nwq; -- 1.7.0.4