From 77cbde8b722dcd47a54abd07cfb33ff8d2d6211f Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Fri, 14 Mar 2025 12:03:09 +0900 Subject: [PATCH] cxl/pci: Fix potential bogus return value upon successful probing BugLink: https://bugs.launchpad.net/bugs/2102266 [ Upstream commit da4d8c83358163df9a4addaeba0ef8bcb03b22e8 ] If cxl_pci_ras_unmask() returns non-zero, cxl_pci_probe() will end up returning that value, instead of zero. Fixes: 248529edc86f ("cxl: add RAS status unmasking for CXL") Reviewed-by: Fan Ni Signed-off-by: Davidlohr Bueso Reviewed-by: Ira Weiny Link: https://patch.msgid.link/20241115170032.108445-1-dave@stgolabs.net Signed-off-by: Dave Jiang Signed-off-by: Sasha Levin Signed-off-by: Koichiro Den Signed-off-by: Mehmet Basaran --- drivers/cxl/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 659f9d46b154..b93fdea70d63 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -917,8 +917,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (rc) return rc; - rc = cxl_pci_ras_unmask(pdev); - if (rc) + if (cxl_pci_ras_unmask(pdev)) dev_dbg(&pdev->dev, "No RAS reporting unmasked\n"); pci_save_state(pdev);