Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1824594rwl; Sat, 8 Apr 2023 02:37:31 -0700 (PDT) X-Google-Smtp-Source: AKy350ZWJGpUv6bG55QaOUvwTNr7/Ozu7s2paWwKG/SdQxTH4y8AjmdFPfZ2nJGaxrb4g9psnS3n X-Received: by 2002:aa7:9f89:0:b0:62d:91b0:b369 with SMTP id z9-20020aa79f89000000b0062d91b0b369mr4687185pfr.26.1680946651070; Sat, 08 Apr 2023 02:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680946651; cv=none; d=google.com; s=arc-20160816; b=xvxM2BXQ0jvKvGjdLvD3XNGRNzCXYlH5EkgJ/gTdjoZkaNPSoMroohhR25z/zAhvlI u+7IxCVz+V2iMOVRrM3KEbfujgJsFxku08Yswe+N0ULj4Dluft5DDRn34e0f3XfW2TjM vDEAq2AvzDUYQ0xfwAVtPw6h4R2kko6jJRHe0Dt/wOA/U4iFFK6+ihq/jsvTPxTwNBb2 a2VPy72X0SUbkQdz+D/mNcFWUYKiASKU3/tDBFQ8cXXBPUtoKByl6xLa8N96a113xEWq zdWg8AnEtuzJTCwa4V3DUL6eWdR645TzEXh1Y7WbSd28kAlNv5jJTgfZ3Yu06HRldrmW 66zw== 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=rBhLJQMw67xpWUZdJokult/rcqiXgNzNv5R0jkcLIbc=; b=CV/49Ml0CCqavzMOHwmgaLiVC535PrRBjZDzO88drWelXnBTBNZHbliMOvqyqaSu3P pXeGQ528drGZkQdv1I+YpsnNGdpI/6otAlonJyS53XuXvSKXtJd6kjtYiIjA+CC8Wj16 E81czn1n4mj9JUXJZR2IInJMix4onA4zh35y5vx2iRfdU7cqDa90P27v9PkCD4UPYCGW 1PTofDHVXRao2PHo1nt0TXgc+jbzhro04iXfRmDmt4z+7uQdnuB9X+SakU0wER7onbP1 nZYHioFRdVbFJEb5HAYq9pq1z6AIaK0zA9x7MCcO8C1Nw7O0Ex+xgteKr7Lbdmisni3R s4rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BjHM/Kr0"; 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 i64-20020a626d43000000b0062526c6ed29si5642201pfc.237.2023.04.08.02.37.19; Sat, 08 Apr 2023 02:37:31 -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="BjHM/Kr0"; 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 S229957AbjDHJd5 (ORCPT + 99 others); Sat, 8 Apr 2023 05:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjDHJdt (ORCPT ); Sat, 8 Apr 2023 05:33:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7322EFB3; Sat, 8 Apr 2023 02:33:42 -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 53FC5612BF; Sat, 8 Apr 2023 09:33:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30B75C4339C; Sat, 8 Apr 2023 09:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680946421; bh=5LHQVHYel5tv55ztru138A8JQd/HYVLUrFnHcljVTiA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BjHM/Kr07XN8ck+U7nzCJ7/fg/No4INN7jFcELLVWWxOrrUreQHQXDtdAGVkXe6mj 7CldqvrsdV8Mt9O2WiGLSXhQZDiqPn0stBgKcyXhxQujSuNH8HAYcfhJUHYDgxRuwT tUChXCxb0HbYIoMLFcXoawGO5fRNeojKLK1Wcjb0vL8fz5XbxU9jZL/S5r5m7P9OuI mJW6R49z5ZPqciLtB7doeZhNCm8JIcf8sXIDORahroxAGuA4WprDHHNfHG0YQW9aNS IA2q1xK65boss1LShXSz+m55/j7bJfri5RvAUcSIhHf3hHbgQhWYUqtE93uTPqS7RK TXCXG7hEeIR+g== Date: Sat, 8 Apr 2023 15:03:30 +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-vntb: Add missing check for alloc_workqueue Message-ID: <20230408093330.GF11124@thinkpad> References: <20230104090808.46085-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: <20230104090808.46085-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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:08:08PM +0800, Jiasheng Jiang wrote: > Add check for the return value of alloc_workqueue since it may return > NULL pointer. > > Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP") > Signed-off-by: Jiasheng Jiang Reviewed-by: Manivannan Sadhasivam - Mani > --- > drivers/pci/endpoint/functions/pci-epf-vntb.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c > index 04698e7995a5..05c99185ba65 100644 > --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c > +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c > @@ -1441,6 +1441,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 > -- மணிவண்ணன் சதாசிவம்