diff mbox series

[-next] phy: cadence: Sierra: Fix error return code in cdns_sierra_phy_probe()

Message ID 20210517015749.127799-1-wangwensheng4@huawei.com
State Accepted
Commit 6411e386db0a477217607015e7d2910d02f75426
Headers show
Series [-next] phy: cadence: Sierra: Fix error return code in cdns_sierra_phy_probe() | expand

Commit Message

Wang Wensheng May 17, 2021, 1:57 a.m. UTC
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: a43f72ae136a ("phy: cadence: Sierra: Change MAX_LANES of Sierra to 16")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
 drivers/phy/cadence/phy-cadence-sierra.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Vinod Koul May 31, 2021, 8:20 a.m. UTC | #1
On 17-05-21, 01:57, Wang Wensheng wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c
index 5c68e31..e93818e 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -940,6 +940,7 @@  static int cdns_sierra_phy_probe(struct platform_device *pdev)
 	sp->nsubnodes = node;
 
 	if (sp->num_lanes > SIERRA_MAX_LANES) {
+		ret = -EINVAL;
 		dev_err(dev, "Invalid lane configuration\n");
 		goto put_child2;
 	}