Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp495227ybe; Wed, 4 Sep 2019 03:09:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuSZyYYhmS4iMxta+Bbn6qYnyxI3BJM9bg8zAiBld8blBkw5ildRocCJZRA8cZI1f7J5/E X-Received: by 2002:a63:ee08:: with SMTP id e8mr35089378pgi.70.1567591753738; Wed, 04 Sep 2019 03:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567591753; cv=none; d=google.com; s=arc-20160816; b=CC7lylpMBmh/B5vU7zYN8Zx7xly2ahFRTeZJxpBWA+Zjv4rnE5qkvn61F41IUfOlIK StXDC6DU+KxWLlRWy6ald/luEUlCUumQNDgNY3PYLtap/rqChdM58fK9JxAtxgoHXFM+ LNa7eiinJrGYt3XvNKa9O0v48olz3pT9ZxtIJ8pntM24jgTrszEzLGaifezVpxSs64f2 cDaljI0Z/+68rE5SnTKa0VcP6NZgZCLdKUzmUQMce0ieYGYP8d8O1Ldhy9YQlRnSJVIq TJWt/jk3uaR5QChCmOacmhuWO2mW/ZIN/dB0IhnHlcd57Ta0WrRRIA2XENf9yfOslOob RpjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=e2BrmU+uca52Vo3Z7sK7q+cckLdS/scrWGQhJ4CcN9g=; b=fEBuOnMLSuodB91PNWib+Budiudm4Lt6gIXmnbOh1LgO2W56K6FOPP/uHowzDCo14n oLfPaslXkos0ovvLAmOkBPjtOM7RXJ0n51Xuw+F+VFe6xB4OiqZbzsfhOVQXxz0FhoE+ tNNJfWGXAnRQ3PlR8ETdQMWDtcHPAEMhNM7cd6FwNH4Ro03nJ4hFG79u4mtkl+XrbFkZ 5NYHw3gWb/eUXp6vEKBht0nFa8pi2sDbeWdiDNnSJsGYvLmZjEgbQA0THJmCIHywAaXY 2a3yP6wfcFUrWCHyDovsLn35znUxXwo9ZqWEmpgBel78cLjkq+6uDaRqdlwffc6PxUl7 7arA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si16951887plp.341.2019.09.04.03.08.53; Wed, 04 Sep 2019 03:09:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729253AbfIDKGb (ORCPT + 99 others); Wed, 4 Sep 2019 06:06:31 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6640 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726495AbfIDKGa (ORCPT ); Wed, 4 Sep 2019 06:06:30 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D7F48FD5C2E9101ECC8A; Wed, 4 Sep 2019 18:06:28 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 18:06:22 +0800 From: zhong jiang To: , CC: , Subject: [PATCH] staging: exfat: remove the redundant check when kfree an object in exfat_destroy_inode Date: Wed, 4 Sep 2019 18:03:28 +0800 Message-ID: <1567591408-24268-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it. Signed-off-by: zhong jiang --- drivers/staging/exfat/exfat_super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 5b5c2ca..87f858b 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -3487,8 +3487,7 @@ static struct inode *exfat_alloc_inode(struct super_block *sb) static void exfat_destroy_inode(struct inode *inode) { - if (EXFAT_I(inode)->target) - kfree(EXFAT_I(inode)->target); + kfree(EXFAT_I(inode)->target); EXFAT_I(inode)->target = NULL; kmem_cache_free(exfat_inode_cachep, EXFAT_I(inode)); -- 1.7.12.4