Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1457146rwi; Thu, 20 Oct 2022 12:44:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61SC8yEVrnxnyJfeFC1qU9Q6D0fyZWUd9LKdgveJQ7O6KabtC/bUfnA2xuHnpw0XTpCGB1 X-Received: by 2002:a05:6a00:2409:b0:54e:a3ad:d32d with SMTP id z9-20020a056a00240900b0054ea3add32dmr15327508pfh.70.1666295061781; Thu, 20 Oct 2022 12:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666295061; cv=none; d=google.com; s=arc-20160816; b=qcKIXG8aijC99qBWe6HUYd8/9CnFm8zUoCo+bzEWzM7o4z3PCUsbWeZ2fwD9sh3FMe 3UhvlMKFpHYTgeQ/Lsbm0W+fqMwX+Qc1I5WzTukQIyuBm5m0Q0q9l/zmslZxTuWuXvlW w6MUgZp9chp++wWktqeVA5edJHYNRc1FnBnRE9hUgP6Q4tgc25Tz+cyqnEpa/UtX9lvf zfW7h27M1pukGP44JIgDBmHUdDAXg4mxNzjx01DJat8HPImM51Gp1H0JjKPwrVKzKybb H6m7ar0tyZyXw5ndw5CRoU2VSCESJDhH/JIlOzF+DI0fCLdsXIWUh3V1CKp/ZtRPbU0a DxIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=x49Z+7yaL6RwbBM/d/Smlwh4k0EElIW3u2px9DPPbtA=; b=sG/Q1O7a8AmLSWVvJ1biBzWFv0DY9NUyATjUuDkgLPLU4jWKwkn54/ST8PanyzuCk9 jy936iBdW5R9llNdfPdarWjhvG1lyliFbiQHFlV4uAxrs3847Y/Y91QAQO5T8LeYWrNY n0CcTTZzbV2mpMQT91lkaOwKLKJNUrxEMKwPxA/ko5VSaC+4ZhYnOsol4wy23EIotSny pv2zx1852bE6Aw+syI2l2s7REZ1TtfthGE2hDscHWJaJO1KJXljtk6ILf7b+O3kXqhSn +c/5wu6yQNYlacNEgxUVUkdBHsLRVBA0gRgiRGdcq6QUPrpOhgWkq6cHGw6uCeJXLkdF 6byQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot1-20020a17090b3b4100b0020de216d0c4si5391412pjb.61.2022.10.20.12.44.09; Thu, 20 Oct 2022 12:44:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229484AbiJTTVV (ORCPT + 99 others); Thu, 20 Oct 2022 15:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiJTTVT (ORCPT ); Thu, 20 Oct 2022 15:21:19 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9156D1E8B9A for ; Thu, 20 Oct 2022 12:21:14 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id lb6No437EXaJmlb6Nox20h; Thu, 20 Oct 2022 21:21:12 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 20 Oct 2022 21:21:12 +0200 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: "Michael S. Tsirkin" , Jason Wang , Wu Zongyong , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , virtualization@lists.linux-foundation.org Subject: [PATCH] vdpa: Fix an error handling path in eni_vdpa_probe() Date: Thu, 20 Oct 2022 21:21:09 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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 After a successful vp_legacy_probe() call, vp_legacy_remove() should be called in the error handling path, as already done in the remove function. Add the missing call. Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI") Signed-off-by: Christophe JAILLET --- drivers/vdpa/alibaba/eni_vdpa.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/alibaba/eni_vdpa.c b/drivers/vdpa/alibaba/eni_vdpa.c index 5a09a09cca70..cce3d1837104 100644 --- a/drivers/vdpa/alibaba/eni_vdpa.c +++ b/drivers/vdpa/alibaba/eni_vdpa.c @@ -497,7 +497,7 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (!eni_vdpa->vring) { ret = -ENOMEM; ENI_ERR(pdev, "failed to allocate virtqueues\n"); - goto err; + goto err_remove_vp_legacy; } for (i = 0; i < eni_vdpa->queues; i++) { @@ -509,11 +509,13 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) ret = vdpa_register_device(&eni_vdpa->vdpa, eni_vdpa->queues); if (ret) { ENI_ERR(pdev, "failed to register to vdpa bus\n"); - goto err; + goto err_remove_vp_legacy; } return 0; +err_remove_vp_legacy: + vp_legacy_remove(&eni_vdpa->ldev); err: put_device(&eni_vdpa->vdpa.dev); return ret; -- 2.34.1