Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1482955pxb; Thu, 28 Oct 2021 04:44:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvWOrwwrc9sPsBF9k1GnCQG74mQp+1aKL6zgZJuQy/7dmI03OgGQ4a6j8YZtv2D5iV4ngZ X-Received: by 2002:a17:90a:5b0c:: with SMTP id o12mr3986352pji.194.1635421495972; Thu, 28 Oct 2021 04:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635421495; cv=none; d=google.com; s=arc-20160816; b=GBdtmZlLmM86aVZq3FGWv6qyix1YhDkG7lsFFPV/BuZG+XNjd+V0C6q8/1/u5Ud/Z0 fH5vThzbwx2dhLSSaAYekZ50wXoKWrRsehowSHJaBep/wyMXunZwu8SqayRGNBMeghta gxo/epp6aXhUV7dmK4y6hUUG+j8FLBJhF2Za6Ga4FeI8C+3x541Bwig7R1mEFzNtNL4M YuSr55ySzkIEtSz1qeBXo8oMPyszdUig6hv8XWai7ZPsg+1o5qVlj7JzE4Ah0GYHUc0K 6vL90/S9C6XZCihxJQXsaKdzeYPIPCSPh3tkGmAOMe5VUqvhotDxsT2k9DlQ10+mOpzB F8GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=aHQ+21TCN3tcMXyUYAQ0ctXGyvRyA01J7XaqgVcKLz8=; b=KhWdsSUaTUCJE6lOJod98gwx/Joo+R09Sxjg7OeMq5xAt4EMvTVNQFJgMC9LLDNolq Sff+yBbfz0Bqa1ELLSvzU0eP8XCvFrw3yy3uurdYyLxyEJAdIJaDOjUdDwCRY0xTPmof Z9El0YIHeA+MtujNulSBua/l//zErSMSHAr80YzjtVyLfRaTp5+HWgnRcvfckQ+UEX/A zI7KWcagHU0OzeRnJsivruFQE4TY3RTAWK5/e4NRlObI+m6YkRAAVmUN/YlJ7MxEzR6N vohbTssnpsKHG9szxkGDD8UC6S8EjPP1d8rlU0AekaJJVrR4R2Kh7kVg6GydZ7uMEU/x NCQA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si3519639pgp.104.2021.10.28.04.44.43; Thu, 28 Oct 2021 04:44:55 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbhJ1LpD (ORCPT + 99 others); Thu, 28 Oct 2021 07:45:03 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:38445 "EHLO mail-wm1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhJ1LpC (ORCPT ); Thu, 28 Oct 2021 07:45:02 -0400 Received: by mail-wm1-f47.google.com with SMTP id a20-20020a1c7f14000000b003231d13ee3cso9066393wmd.3; Thu, 28 Oct 2021 04:42:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aHQ+21TCN3tcMXyUYAQ0ctXGyvRyA01J7XaqgVcKLz8=; b=exm+zt+dRxcInfXk9ru2AsJplMr8vPqX8EGYgpTIX/IB67ENmzYaIba+Vj8XCIiTak 6Sup7AcpFvU+7YedD8ecCeZQPcFKFkGa0q4w0U55UoQd8ulTGeHHX0XBk0QpIOVYRLy2 apRAHjBQmzH91Vsa4H9jal38DnRspgyEnponsi6nMjxuRnSKy5ug+wJv8xgALy//7Ufa i/JPc3HokTZV5dzAd2ATlVfPv+hpg3b8Q5mVJ3Evc9Nzih6qU9Fo984xghJELsMtjJKN nThtsYCuEQVVn9U1P7MwJdu86s/SXtjSZkPPyMiAmtG/0BhNlTmF83HxzRXDSmKT7vQ5 Yb4A== X-Gm-Message-State: AOAM531aY4h70qZVevn3kr05lR3IkdggiPjWc3NwmbCrxQ/oMLlhwxZ7 qMeNuIRBatA98rySESaTA70= X-Received: by 2002:a1c:2785:: with SMTP id n127mr3833667wmn.155.1635421354755; Thu, 28 Oct 2021 04:42:34 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id p12sm3066706wrr.67.2021.10.28.04.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 04:42:34 -0700 (PDT) Date: Thu, 28 Oct 2021 11:42:33 +0000 From: Wei Liu To: cgel.zte@gmail.com Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, Lv Ruyi , Zeal Robot , Tianyu.Lan@microsoft.com Subject: Re: [PATCH] Drivers: hv : vmbus: Adding NULL pointer check Message-ID: <20211028114233.nebhfxgait6qy2xa@liuwe-devbox-debian-v2> References: <20211028104138.14576-1-lv.ruyi@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211028104138.14576-1-lv.ruyi@zte.com.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 10:41:38AM +0000, cgel.zte@gmail.com wrote: > From: Lv Ruyi > > This patch fixes the following Coccinelle warning: > drivers/hv/ring_buffer.c:223: alloc with no test > > Reported-by: Zeal Robot > Signed-off-by: Lv Ruyi > --- > drivers/hv/ring_buffer.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c > index 931802ae985c..4ef5c3771079 100644 > --- a/drivers/hv/ring_buffer.c > +++ b/drivers/hv/ring_buffer.c > @@ -223,6 +223,8 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, > pages_wraparound = kcalloc(page_cnt * 2 - 1, > sizeof(struct page *), > GFP_KERNEL); > + if (!pages_wraparound) > + return -ENOMEM; > (CC Tianyu) This hunk appears to have been mistakenly deleted by Tianyu's IVM patch set. Thanks for noticing this. Applied to hyperv-next. No "fixes@ tag needed here. Wei. > pages_wraparound[0] = pages; > for (i = 0; i < 2 * (page_cnt - 1); i++) > -- > 2.25.1 >