hte: tegra: Fix missing error code in tegra_hte_test_probe()

[ Upstream commit b7c3ca3553 ]

The value of 'ret' is zero when of_hte_req_count() fails to get number
of entitties to timestamp. And returning success(zero) on this failure
path is incorrect.

Fixes: 9a75a7cd03 ("hte: Add Tegra HTE test driver")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Harshit Mogalapalli 2023-10-26 00:53:28 -07:00 committed by Greg Kroah-Hartman
parent 2c7c560262
commit 19e557524d
1 changed files with 3 additions and 1 deletions

View File

@ -153,8 +153,10 @@ static int tegra_hte_test_probe(struct platform_device *pdev)
}
cnt = of_hte_req_count(hte.pdev);
if (cnt < 0)
if (cnt < 0) {
ret = cnt;
goto free_irq;
}
dev_info(&pdev->dev, "Total requested lines:%d\n", cnt);