]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Octeontx2-af: Fix missing error code in cgx_probe()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Fri, 10 Oct 2025 20:42:39 +0000 (13:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Oct 2025 14:24:30 +0000 (16:24 +0200)
[ Upstream commit c5705a2a4aa35350e504b72a94b5c71c3754833c ]

When CGX fails mapping to NIX, set the error code to -ENODEV, currently
err is zero and that is treated as success path.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aLAdlCg2_Yv7Y-3h@stanley.mountain/
Fixes: d280233fc866 ("Octeontx2-af: Fix NIX X2P calibration failures")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251010204239.94237-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/cgx.c

index 69324ae093973ed8c6e06b3b70d1d7d7a96380bf..31310018c3cac97e31d3024462b4444b1f0905bf 100644 (file)
@@ -1981,6 +1981,7 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
            !is_cgx_mapped_to_nix(pdev->subsystem_device, cgx->cgx_id)) {
                dev_notice(dev, "CGX %d not mapped to NIX, skipping probe\n",
                           cgx->cgx_id);
+               err = -ENODEV;
                goto err_release_regions;
        }