Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp944292imm; Wed, 8 Aug 2018 08:14:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyu0PZN6QBuI0yiwxLm2rAl8mbY/7RA4sbZ5yfUbgQ2AYzpXSqGD8sKoUiZX8GXBFt1ZtIT X-Received: by 2002:a63:aa44:: with SMTP id x4-v6mr3050343pgo.120.1533741262828; Wed, 08 Aug 2018 08:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533741262; cv=none; d=google.com; s=arc-20160816; b=YhBKDQooRwcNZp+KLZfweDY76Ny9WNE/oua4ftUqcm1mGhTDuLJk4vUl1txvLjXQIT bMwQaYqC4tN5yQ6URG01X5NuCicB9z8NaXFAjjn1JXu7QzUs1ytzJK3PZL6x96OdyKsq lc6wJYRNOt0Mu2tG8kyNWZNPne+MDl3/y3A2yYbrGEd+Ktg3v2zT+MT0yrXAwPYEPtwJ BxWh6JaQMIe4UzRtBy8mmBI8v285pqccqO8VghYn3T0pKGIkh19yZ8/IL1SHb1vHVFdH BvnJ+CkVE1PS2WlHPV+2ScXuBonEbmmwZmvh0sUg3UyedLRniClWi9RuFP8QeDMhBJiJ CWWA== 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:arc-authentication-results; bh=ZbIsFQh/WAuDIrwd8IpD7Ux0eLaSz2g++NhJLcB16jM=; b=Og6DuomgkG7azbRGimmEdF/VzmKyZGokegVn9eUBk76wrFtfRtCLnDbILEXTmUkniY kulh3+kq4HcEPkbmI91zsyRtygpVOy5+3uR0KVK6ltrZaY56M57v44qwLWOj3xEqP6Vj spOQo3YDX1gSSRPwvMFj3StUEEQv5eB5VCvGEyM7cY/pUubAmTnv30WgmmVcPaSACWCw QEdz74NSGKB0Ksf7n00a+n6hJFze0cJalkBG9AEHDIUbpwE4qn5lR6ZwNpyM/K0E5dbl HTnd+V6Swatc2QSOb8bPEl/UGRIX4n9zaMIqRGfUJc7mHpRsk4/0rwyrI+iIarQMFgav oNeA== 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 c18-v6si4388999pgd.448.2018.08.08.08.14.08; Wed, 08 Aug 2018 08:14:22 -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 S1727692AbeHHRcd (ORCPT + 99 others); Wed, 8 Aug 2018 13:32:33 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52622 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726875AbeHHRcc (ORCPT ); Wed, 8 Aug 2018 13:32:32 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 8F07B3BD0384D; Wed, 8 Aug 2018 23:12:19 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.399.0; Wed, 8 Aug 2018 23:12:16 +0800 From: zhong jiang To: , CC: Subject: [PATCH] drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy Date: Wed, 8 Aug 2018 23:00:35 +0800 Message-ID: <1533740435-12088-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 mempool_destroy has taken the null pointer into account. So it is safe to remove the null check. Signed-off-by: zhong jiang --- drivers/block/aoe/aoedev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index 697f735..41060e9 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c @@ -284,8 +284,8 @@ e = t + d->ntargets; for (; t < e && *t; t++) freetgt(d, *t); - if (d->bufpool) - mempool_destroy(d->bufpool); + + mempool_destroy(d->bufpool); skbpoolfree(d); minor_free(d->sysminor); -- 1.7.12.4