Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5976714ybi; Wed, 29 May 2019 00:30:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+VrJTMNHrOnDXsA24dlJxD7cwA5+pnHi29Uxf0NthaUS58gRgwZ+6OxmU7oApZYTMKkCr X-Received: by 2002:a17:90a:d995:: with SMTP id d21mr10573886pjv.56.1559115014417; Wed, 29 May 2019 00:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559115014; cv=none; d=google.com; s=arc-20160816; b=lhOMIEooKtu3snGUYjmJ/cp6bX0mBAfwHrnlOLjD6iFfrTHyPeSmNiNQge81y6b9nP SalR1+fxD1Zx5Nu4+LjoKfUJanmjgiCgRvqVTO/gvA2/o2oXjPYx7XlFZu6fdzNpWSvo 06RT37Ic8Bw1vZQv0rFpU402+TR4IvGw6Zfhk6uiN69TG6GeTTYWHkpVdRiGKN84m2B3 88TH+sT6DRoTZMXK0lNJRCoKokFlMHly7pf1I3CCR3qBso+RbzsfXhGiqvMcPYEwIqfp 5kxaGPBtaa1eEAme6UulzJrx6mWNuAIqs3G9BgVYKI/s7oNBohupGqUf9/4vhsPFpwH4 WMnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4CvRQ0rhu/43nqch6Ac0D1XJ2RDqyBsMVJLnxBKp1QY=; b=XM8Ne+PqQkAhlvxxhP7JAdwANR5m4hOlRf/6YiPHHtXMqsNoAtxW/6aFxZ1uIKoncQ SfhCmc+GY8zz23nImrm5a3gVs9rwKyTwnAaY4nRcHRAp6jvKayZAly8EgOF9mISRXsRd Z0cl/cutiAv/MaoTNF/Cz3K9ZusN/UAAb+W+QZuFg3wnrpiRTxbruT5o8P0ooJonf4Lw 48+/rVDDXlHzGOZ5Pli6LzcjcQZoh/bzY2iSh4kkytCihJei6zYbPiomSXlc6XxxeO8h ++ORGereTapI19vKvjyGLYtyt87mtvgqzIQIYZ9ShbmKmvO33fAs2BKV7riIpruuV43s 14ag== 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 e67si24497917pgc.11.2019.05.29.00.29.58; Wed, 29 May 2019 00:30:14 -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 S1726604AbfE2H2W (ORCPT + 99 others); Wed, 29 May 2019 03:28:22 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:2495 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfE2H2W (ORCPT ); Wed, 29 May 2019 03:28:22 -0400 X-Greylist: delayed 544 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 May 2019 03:28:19 EDT Received: from spf.mail.chinamobile.com (unknown[172.16.121.5]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee55cee326f7cd-dbd1a; Wed, 29 May 2019 15:19:11 +0800 (CST) X-RM-TRANSID: 2ee55cee326f7cd-dbd1a X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee35cee326e9c7-1e858; Wed, 29 May 2019 15:19:11 +0800 (CST) X-RM-TRANSID: 2ee35cee326e9c7-1e858 From: Ding Xiang To: dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mtd: afs: remove unneeded NULL check Date: Wed, 29 May 2019 15:18:22 +0800 Message-Id: <1559114302-10507-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NULL check before kfree is unneeded, so remove it. Signed-off-by: Ding Xiang --- drivers/mtd/parsers/afs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/parsers/afs.c b/drivers/mtd/parsers/afs.c index 0c73002..972b260 100644 --- a/drivers/mtd/parsers/afs.c +++ b/drivers/mtd/parsers/afs.c @@ -383,8 +383,7 @@ static int parse_afs_partitions(struct mtd_info *mtd, out_free_parts: while (i >= 0) { - if (parts[i].name) - kfree(parts[i].name); + kfree(parts[i].name); i--; } kfree(parts); -- 1.9.1