Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp49829pxb; Thu, 21 Jan 2021 00:36:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyt1/3Y6jHKx2jht+tLP/5oB0DEPqwG7kswugdgGDzGrvo6HeeUNAhrHPcTeakDOgjYjC4i X-Received: by 2002:a17:906:c78b:: with SMTP id cw11mr8634488ejb.448.1611218206295; Thu, 21 Jan 2021 00:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611218206; cv=none; d=google.com; s=arc-20160816; b=P2mYWU6pp0AcbV7iawuq23aZvYh9OrRKyxyT+D9LWhBM5qwLm2SMqloyOl/tnw9626 igsVzQpaG5U6CqKraqFirJAH4YTrcNCzGogubNaLYCrA/QSKXZrupDKwGcPX7zy6i+V2 CFMedoNS2euaLU2NF9R/+d8R5c7gVB+j1MSMUG2GSjY6qsKZkCdk1usKqw1IpJUQgX/i Q0ZQr3xylRuk3lebqZjTkTllul7Vx6m0X8faDFPZZAosrsx2mHjlNu/S5c8Ud6EuBmxy 5uojH+qqY+ivASSBsZG6frzUxLCDizEjXehK42VJiM9TPuuqw343+hoK4qOQtKPSB8sH TefA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HnG9+0RBizHJhdR3XOmg9XhnuWR/2oFpzyHyFXQE+as=; b=QAW0uzvKgb1pjXggzJjA0hpmPZuS4zLcOne+OY7YZgSBO1cstFYy91UYIRuKr98jZd HP4XDTZKR2Q4YhALWlvkRScTo+/o51vhUEmjZMb0EXXcKtDKnd7nvdXETnMS0F+xW494 RfSIrRVxCzFJAAy8nHBaKg3BkE3xvUyRRbBb9tmxNShIrAH6mZQV39/5wm5Ir621c8r0 LkULcLHVy+iD7wmxwXZUDkMXQ6l/olm7LEmiba4z8vQrymoLT4r6nyxNjGg9rp21O+2e 4Wbc7vaC/NdAWaNx8+K2+zg8je/T8F6+hrOvcpMmnY5COhq6Eke/AhHahQvDZSNSdm4a Lsuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D8b4OlJ3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si1848941edq.123.2021.01.21.00.36.21; Thu, 21 Jan 2021 00:36:46 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D8b4OlJ3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbhAUIeo (ORCPT + 99 others); Thu, 21 Jan 2021 03:34:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44198 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726208AbhAUIZd (ORCPT ); Thu, 21 Jan 2021 03:25:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611217447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HnG9+0RBizHJhdR3XOmg9XhnuWR/2oFpzyHyFXQE+as=; b=D8b4OlJ31UOWNPSzJCA7y4a4fORqVe/9lOG8Hth4OCnhXz2pDNp9Kwfo/pmSiowlVrxhOH pw6M37WxLaC+3C7MAZGeq8qcu/o0aopYfF0udiSDMAOtHLEJHWgGJ1CLYM5QzVLIWtv8wf vwoDXY7oorTp3YnI/dxVLf53cN8wAd8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-275-OPYDEMhJO_mTgSN1dF2UwQ-1; Thu, 21 Jan 2021 03:24:04 -0500 X-MC-Unique: OPYDEMhJO_mTgSN1dF2UwQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE95D59; Thu, 21 Jan 2021 08:24:02 +0000 (UTC) Received: from localhost (ovpn-12-177.pek2.redhat.com [10.72.12.177]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEB352C318; Thu, 21 Jan 2021 08:23:58 +0000 (UTC) Date: Thu, 21 Jan 2021 16:23:56 +0800 From: Baoquan He To: Yang Li Cc: dyoung@redhat.com, vgoyal@redhat.com, adobriyan@gmail.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] vmalloc: remove redundant NULL check Message-ID: <20210121082356.GH20161@MiWiFi-R3L-srv> References: <1611216753-44598-1-git-send-email-abaci-bugfix@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1611216753-44598-1-git-send-email-abaci-bugfix@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/21/21 at 04:12pm, Yang Li wrote: > Fix below warnings reported by coccicheck: > ./fs/proc/vmcore.c:1503:2-7: WARNING: NULL check before some freeing > functions is not needed. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > fs/proc/vmcore.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c > index c3a345c..9a15334 100644 > --- a/fs/proc/vmcore.c > +++ b/fs/proc/vmcore.c > @@ -1503,11 +1503,8 @@ int vmcore_add_device_dump(struct vmcoredd_data *data) > return 0; > > out_err: > - if (buf) > - vfree(buf); > - > - if (dump) > - vfree(dump); > + vfree(buf); > + vfree(dump); Looks good, thx. Acked-by: Baoquan He Thanks Baoquan