Commit 9e6cad53 authored by YueHaibing's avatar YueHaibing Committed by Jakub Kicinski
Browse files

net: macb: Fix passing zero to 'PTR_ERR'

parent 2e793878
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -3711,19 +3711,13 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
	}

	if (IS_ERR_OR_NULL(*pclk)) {
		err = PTR_ERR(*pclk);
		if (!err)
			err = -ENODEV;

		err = IS_ERR(*pclk) ? PTR_ERR(*pclk) : -ENODEV;
		dev_err(&pdev->dev, "failed to get macb_clk (%d)\n", err);
		return err;
	}

	if (IS_ERR_OR_NULL(*hclk)) {
		err = PTR_ERR(*hclk);
		if (!err)
			err = -ENODEV;

		err = IS_ERR(*hclk) ? PTR_ERR(*hclk) : -ENODEV;
		dev_err(&pdev->dev, "failed to get hclk (%d)\n", err);
		return err;
	}