Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6742444rwl; Thu, 29 Dec 2022 19:46:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXtCYwJHrWnsTQSmV2lgXtJSl2uxmrrzof+1oL9qNrUP5N5qWoGLPAxSEw49Hbm7jkdYaqEG X-Received: by 2002:a17:906:37c8:b0:839:72d5:cd2e with SMTP id o8-20020a17090637c800b0083972d5cd2emr25104623ejc.53.1672372005477; Thu, 29 Dec 2022 19:46:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672372005; cv=none; d=google.com; s=arc-20160816; b=TpjpOFWXfVtXSPNHEopfhwomIZeb8Qa36o8w2CUAnUdegp88rPQIKsJr4JMzOIybwm hDpmULDjm6VWrWhyR+Vsuxq3BgMU9KjoqxocszqMMz8ASFvWil7qEpK/Hz7fh74+QOuS 7zrBqXRmIKbM0JqphiYsAwuOGSetvbHxIKkQ2d26tx6vf64d+kwDCwhtY1iZF/191JvE gal6R1ZLzm9oZ52NhcKf0j0UFHuHG2XULfZR87MSYRvavsaCmB19KYzq4cCVDzcX/dp3 KfLNBLgjx6JNjv6OqVB75Te/B/+WUMUbMgc2eoOtQTdmNUz/RqTCB0NboOlRpOLjXP1G PTFw== 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:dkim-signature; bh=BFNXItw3vyVZhILsjsLp8yF7ZYxbZhsawdU/qCEtK+U=; b=RvEEtuwOtAmcBSXOMPCyR91TyRMNd3D5C7YlE2Y3W/yvPM2UIeVlwGIqGDFDPDE7xE zcJs+3zosQXZrUsZDZdj69SJp6Xnj/LZH9uULiznww9+ow0XR7CXciwTGgWMxEgEZVwv wYwLgGfGWB1lIaGwEiOsvfsw1JXu7QIjPhplX200QXdfcc6ZQz3fXCFfmEaeTlPmnZ1I TVBjWhygEnVseqKbdXK9dH8AyFtvxdzs8SAE0IjAfw/09yU1K+Ieco+ZwSQ644NJITOs 25xyxzcsMOmW/TBiZTSH46bxnQkYMiLFQQJw9TZwGpZrh26eB6n1wPAFabdM8g8otTQA oWyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PMfVaeZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j19-20020a05640211d300b004700047ef96si20111194edw.289.2022.12.29.19.46.30; Thu, 29 Dec 2022 19:46:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PMfVaeZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234187AbiL3CoN (ORCPT + 64 others); Thu, 29 Dec 2022 21:44:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbiL3CoL (ORCPT ); Thu, 29 Dec 2022 21:44:11 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D48E12189; Thu, 29 Dec 2022 18:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672368250; x=1703904250; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=W1cu+psy3UKnw7BrB+yN0znRmXff8NyPQPr+AbOVv7Y=; b=PMfVaeZK3hfe0LDWvsE7cq6UKdR7FhiaiIiba+JbGH4Wi0tCQx8fl6wT m/VlyWbS3UrvF98uZsfdUyHLbpP0Nno1tUnl2agFqtDVWZJS2KJWMvGnA 8F+sStnDXd8s6ZvN3ZjuuLWjySYlfXaPHqSp7QmamzW45aO/gZ++8DeD7 F4/dOSWt+6XzjHvzye5jE+6v4ASTIJSWt2Wgem76b72GkDSLv7EVJaozU Zeyl2yYD5UYy5eSij8urwGyIBsjzlXWg5aFD3ddzW3CLnmNTVTA0ze6U9 oAFvRSprYpkqk77nYRKUUSBJ932lhVJUUflgnZE/5Y2kotdPUTiUITyOd Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="385574965" X-IronPort-AV: E=Sophos;i="5.96,286,1665471600"; d="scan'208";a="385574965" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 18:44:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="796120600" X-IronPort-AV: E=Sophos;i="5.96,286,1665471600"; d="scan'208";a="796120600" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmsmga001.fm.intel.com with ESMTP; 29 Dec 2022 18:44:07 -0800 Date: Fri, 30 Dec 2022 10:34:00 +0800 From: Xu Yilun To: Russ Weight Cc: Zheng Yongjun , mdf@kernel.org, hao.wu@intel.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, trix@redhat.com Subject: Re: [PATCH] fpga: stratix10-soc: Fix return value check in s10_ops_write_init() Message-ID: References: <20221126071430.19540-1-zhengyongjun3@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-11-28 at 17:26:23 -0800, Russ Weight wrote: > > > On 11/25/22 23:14, Zheng Yongjun wrote: > > In case of error, the function stratix10_svc_allocate_memory() > > returns ERR_PTR() and never returns NULL. The NULL test in the > > return value check should be replaced with IS_ERR(). > > > > Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver") > > Reviewed-by: Russ Weight > > Signed-off-by: Zheng Yongjun Acked-by: Xu Yilun Applied to for-6.2 and Cc: stable@vger.kernel.org > > --- > > drivers/fpga/stratix10-soc.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c > > index 357cea58ec98..f7f01982a512 100644 > > --- a/drivers/fpga/stratix10-soc.c > > +++ b/drivers/fpga/stratix10-soc.c > > @@ -213,9 +213,9 @@ static int s10_ops_write_init(struct fpga_manager *mgr, > > /* Allocate buffers from the service layer's pool. */ > > for (i = 0; i < NUM_SVC_BUFS; i++) { > > kbuf = stratix10_svc_allocate_memory(priv->chan, SVC_BUF_SIZE); > > - if (!kbuf) { > > + if (IS_ERR(kbuf)) { > > s10_free_buffers(mgr); > > - ret = -ENOMEM; > > + ret = PTR_ERR(kbuf); > > goto init_done; > > } > > > > -- > > 2.17.1 > > >