From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E0A94E1D8; Tue, 23 Jan 2024 00:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705969985; cv=none; b=kXMJXszdt+E8zzDVUOkVnaJVz/pTUZCTiK5b2OhovBLM/Z7kD/TRFQCv5hPawffz+WHfvs5LbQ1+mFMm+IkpHD8CJPxqvNs9YqpHFlNI/vGV3uDjBqknKec367iUTvS4DGFqKNMZKnRtCD9XIm5yzDtocWxmXrqBhYBXHVuSrts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705969985; c=relaxed/simple; bh=qffpP7hfvNJFv3sfr5ybEsyilsyo+397Mbb1DeIjQ8I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UmTf2J5/NCIfarJiQ8svrr1cgOHzRjgzDpnilye7fa8EbCb85wu+IxLhBSrfqBqLM4qwHIfVjQEcbSdXUB/JcyDC18gz/27T2MAAMjMj4Z/xFjtcoXS250RLpod5P6u09FYhrvW5pMgNHJuUOxrSiY6xLf0lCs80ETbBuNzYAbM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IDTcDRj/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IDTcDRj/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61289C433F1; Tue, 23 Jan 2024 00:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705969985; bh=qffpP7hfvNJFv3sfr5ybEsyilsyo+397Mbb1DeIjQ8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IDTcDRj/BRJBH+SLU8zJgPMJkCTAKUVTven62ntYVZG4yiynPIjam0qKxrJrp/kLd QX0+0Gp/rzDvxk7HDMLHXI9iOjQ9m2xxVc1YayHElrE9mS8KC3FnEkMRi0uRiD5BwX VIwtTvxBcXCXtsDCBEyG+qYxXi/kKrH0doAfpeCY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe JAILLET , "Michael S. Tsirkin" , Jason Wang , Sasha Levin Subject: [PATCH 6.7 551/641] vdpa: Fix an error handling path in eni_vdpa_probe() Date: Mon, 22 Jan 2024 15:57:35 -0800 Message-ID: <20240122235835.393892773@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235818.091081209@linuxfoundation.org> References: <20240122235818.091081209@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET [ Upstream commit c1b9f2c66eed3261db76cccd8a22a9affae8dcbf ] 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 Message-Id: Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Sasha Levin --- 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.43.0