hte: tegra: Fix missing error code in tegra_hte_test_probe()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Thu, 26 Oct 2023 07:53:28 +0000 (00:53 -0700)
committerDipen Patel <dipenp@nvidia.com>
Fri, 27 Oct 2023 21:07:15 +0000 (14:07 -0700)
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: 9a75a7cd03c9 ("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>
drivers/hte/hte-tegra194-test.c

index ba37a5efbf82019c5b61ee3e09a46e90e26e5a61..ab2edff018eb6882210a323819444af17470d0ae 100644 (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);