net: ethernet: altera: TSE: fix error return code in altera_tse_probe()
authorSun Ke <sunke32@huawei.com>
Tue, 20 Sep 2022 02:00:41 +0000 (10:00 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 22 Sep 2022 10:25:59 +0000 (12:25 +0200)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: fef2998203e1 ("net: altera: tse: convert to phylink")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
Link: https://lore.kernel.org/r/20220920020041.2685948-1-sunke32@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/altera/altera_tse_main.c

index 89ae6d1623aaaf82117e380a2bbf55d265f942af..3cf409bdb28388122ed55f06af5d60e6c8dbe3ab 100644 (file)
@@ -1411,6 +1411,7 @@ static int altera_tse_probe(struct platform_device *pdev)
                                       priv->phy_iface, &alt_tse_phylink_ops);
        if (IS_ERR(priv->phylink)) {
                dev_err(&pdev->dev, "failed to create phylink\n");
+               ret = PTR_ERR(priv->phylink);
                goto err_init_phy;
        }