Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3295630pxf; Mon, 22 Mar 2021 03:02:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUsd7u0cr3ufyf6dF6OjL9T/9Ce3sQi+TPoZgntJwotbhAHhkmnEm4OrXRnJmIz45l6uSd X-Received: by 2002:a05:6402:1649:: with SMTP id s9mr24682778edx.177.1616407352441; Mon, 22 Mar 2021 03:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616407352; cv=none; d=google.com; s=arc-20160816; b=tIOZGuqvQ+H4svfX6yhACMdTNDk8SbUm2lIgAL8Flsl1BCOXS21E7LDNEflwt89bUX S7NeHP+g2MC4amhpr0D2qu/4YJRg4OsexJOJowxyCsKAxlmE70byqKbHh2S48FO4/kHc RIINqVOEh6XqkO8q8Sb6fIYjVZACXYFEnhU28hVBKOPavJL1ZuRaktt2ARFGdOVRorir r5ZDDjWIVksQ1WqOsQU+zTvnqrSQodO/ZNRD/uYoOpZigdn69RWkgA0/55xoNVj30Y9L 42c2r4i2qoPZRAVqNHJpx4jB/F41+NcUdRF1FgKaGW6gXnqUoADygSNNvXsNkHuHHhnu uu6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=2lHUKECcJRL+AgROh5pXhTv81JON8CPL5BFPE932xQg=; b=gY/XE9A5xWlqhfGdrAWYP8nk28jpX63QfluE7wTPtZHGmTd3MwWzp5cV4BKIRcqzT3 bOWLWE1C+pDG6jPQbGsst2+zsXO7iPx/tkyuFRnBGyzeKcWgl7CBqMRwzxo8oUGOHE31 YUkfJCxzNIHKZ1piBG1l6VDYuQSY+cQ9KV2zoKmUYSbFGHovh5dUL5GekXaj5QObx+dO w4wIIPPiosmGkzZNiGsW1c+pImawXJw5rlMh22OI76a8M/yRbBJbNXU43uf3fmcyq3j4 recWgUVEBvrmw8mnDnYKg9v0Pl/w5oFwob5VEpZfhzop3o0nwuAPkCu1Nqkjnd/SewOI 60BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si11371536ejx.30.2021.03.22.03.02.09; Mon, 22 Mar 2021 03:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbhCVKBA (ORCPT + 99 others); Mon, 22 Mar 2021 06:01:00 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:50747 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhCVKAs (ORCPT ); Mon, 22 Mar 2021 06:00:48 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R491e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0USuX3L7_1616407241; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0USuX3L7_1616407241) by smtp.aliyun-inc.com(127.0.0.1); Mon, 22 Mar 2021 18:00:46 +0800 From: Jiapeng Chong To: dan.j.williams@intel.com Cc: vishal.l.verma@intel.com, dave.jiang@intel.com, ira.weiny@intel.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] ndtest: Remove redundant NULL check Date: Mon, 22 Mar 2021 18:00:40 +0800 Message-Id: <1616407240-114077-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warnings: ./tools/testing/nvdimm/test/ndtest.c:491:2-7: WARNING: NULL check before some freeing functions is not needed. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- tools/testing/nvdimm/test/ndtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/nvdimm/test/ndtest.c b/tools/testing/nvdimm/test/ndtest.c index 6862915..98b4a43 100644 --- a/tools/testing/nvdimm/test/ndtest.c +++ b/tools/testing/nvdimm/test/ndtest.c @@ -487,8 +487,7 @@ static void *ndtest_alloc_resource(struct ndtest_priv *p, size_t size, buf_err: if (__dma && size >= DIMM_SIZE) gen_pool_free(ndtest_pool, __dma, size); - if (buf) - vfree(buf); + vfree(buf); kfree(res); return NULL; -- 1.8.3.1