Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1824031rwl; Sat, 8 Apr 2023 02:36:41 -0700 (PDT) X-Google-Smtp-Source: AKy350a0UMwIalz3dIuhkzZf+nd/EakBK3PKY11wrXtNyGuN/em0LEqt0WWeOg4UiOjR7pqsTtnD X-Received: by 2002:a62:1c96:0:b0:627:e1c3:49d5 with SMTP id c144-20020a621c96000000b00627e1c349d5mr4655241pfc.23.1680946601214; Sat, 08 Apr 2023 02:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680946601; cv=none; d=google.com; s=arc-20160816; b=zXkPZUgfw1i5H4hJ2PRKJeZ0UMAzZjuOofqYzCs+W6BxUtyVcUktZZQdv11UAAT1Hz Mu48NooqLla8uUnKLHTjxsRj6kZMm4oANYNw6efShtPpNIZ/Led9MqGtndOoXEJW2cMA ULDaIkdzW7ijNoXwVwaooR/nQxkkeGJyXHYGrW5WGAOkne7xI3MfxxmQLt5VmebnmVJl hzoyaqYOQ6YS1WQaNg5Qnl2sgymPTItz1AhLmLiG2lZpq0uwvXhZr8D156OlVHzEE0AR CX8TVNYLTxvQiFnSKAOblHm7bz1hVgzCvzX4+dEGLeRimrRXUU03wpDmLXqWBvXxYVIE J6pg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HgD+IoC1zZqkWj1GtQdwNBTl58XOisVs4UzN8X8D4X4=; b=0wWtu9qCEn0u09vAX3uQHw7HtbUUFL6zD3tAkO11Sei5O8R6QtIrV0uU8lE4D0GUXz Eey7n2AeaH3ImxHOC1i/A3VurpkZ3p6AgwvNrBjUrr+t0JIfjz00gZOTciNTA9cymbOB TXR5eQse5VsE6udT01RhkCMOPcXfOBcivHehfLmkOQM+XzHCObPm3vIuN/5q7Cjy9nnJ RuQb3ZoAIBROcNz3Avv3ds3d6krxeRYWcl/Z49SZE2jWmJt6Rhe4fvtn59bfNW46TN0o uSEIr2Mx1rRlfVwd3kq0z1g2ZLr8O2W9HHmRUts+Op4vbaqX+WmuY7f8PKvW9F30kkuW PN0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zi1FXjTg; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d28-20020a630e1c000000b005138c1f1fcdsi5440597pgl.663.2023.04.08.02.36.30; Sat, 08 Apr 2023 02:36:41 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=Zi1FXjTg; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbjDHJd0 (ORCPT + 99 others); Sat, 8 Apr 2023 05:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjDHJdY (ORCPT ); Sat, 8 Apr 2023 05:33:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D607AC14A; Sat, 8 Apr 2023 02:33:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 73B6261277; Sat, 8 Apr 2023 09:33:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8BA8C433EF; Sat, 8 Apr 2023 09:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680946402; bh=1Na8BLaXtLhPBoLxzKdgkj/jz4zip9OEjD2Tn6ZX0ws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zi1FXjTgjY4EAhLbkxFoXQGtfDYOBFigzjC/OeVE5bl2jDhvMUPHmbg0SJGrpbN9F 5gUfRL+LgiVJ21oIZAZLIdTvHS48G0OoQ9BmNvp6xwpZdqvnUcSK9RDeMTq1uWef4+ i9TvitAd/1XhsxeOPap19OZmIM2M+rLNv+t8NUR52KFKm3Rf1vbutb5Ai3cY+qxOEG PmisgCBtiuNe9U4p1FXSVdk/yZq+aW/Qx04r6cOkuWEpvKdvJRPubg+z/AWKMigw74 7iMOkuAtJNKt3NtteIs1A2QJ3xAF0QKLLQKXCVSfkOFwzc6PWH3ReN7rj+Hfm7e5hY HD6IcOwMklWlQ== Date: Sat, 8 Apr 2023 15:03:16 +0530 From: Manivannan Sadhasivam To: Jiasheng Jiang Cc: jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com, lpieralisi@kernel.org, kw@linux.com, kishon@kernel.org, bhelgaas@google.com, ntb@lists.linux.dev, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: endpoint: pci-epf-ntb: Add missing check for alloc_workqueue Message-ID: <20230408093316.GE11124@thinkpad> References: <20230104091601.22719-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230104091601.22719-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Wed, Jan 04, 2023 at 05:16:01PM +0800, Jiasheng Jiang wrote: > Add check for the return value of alloc_workqueue since it may return > NULL pointer. > > Fixes: 8b821cf76150 ("PCI: endpoint: Add EP function driver to provide NTB functionality") > Signed-off-by: Jiasheng Jiang Reviewed-by: Manivannan Sadhasivam - Mani > --- > drivers/pci/endpoint/functions/pci-epf-ntb.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/endpoint/functions/pci-epf-ntb.c > index 9a00448c7e61..304956bc0516 100644 > --- a/drivers/pci/endpoint/functions/pci-epf-ntb.c > +++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c > @@ -2124,6 +2124,9 @@ static int __init epf_ntb_init(void) > > kpcintb_workqueue = alloc_workqueue("kpcintb", WQ_MEM_RECLAIM | > WQ_HIGHPRI, 0); > + if (!kpcintb_workqueue) > + return -ENOMEM; > + > ret = pci_epf_register_driver(&epf_ntb_driver); > if (ret) { > destroy_workqueue(kpcintb_workqueue); > -- > 2.25.1 > -- மணிவண்ணன் சதாசிவம்