net: macb: Fix passing zero to 'PTR_ERR'
Check PTR_ERR with IS_ERR to fix this. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20201112144936.54776-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Родитель
2e793878ae
Коммит
9e6cad531c
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче