* [PATCH] hte: tegra: Fix missing error code in tegra_hte_test_probe()
@ 2023-10-26 7:53 Harshit Mogalapalli
2023-10-26 23:04 ` Dipen Patel
0 siblings, 1 reply; 2+ messages in thread
From: Harshit Mogalapalli @ 2023-10-26 7:53 UTC (permalink / raw)
To: Dipen Patel, Thierry Reding, Jonathan Hunter, timestamp,
linux-tegra, linux-kernel
Cc: dan.carpenter, kernel-janitors, error27, harshit.m.mogalapalli
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>
---
This is found using static analysis with smatch, only compile tested.
---
drivers/hte/hte-tegra194-test.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c
index ba37a5efbf82..ab2edff018eb 100644
--- a/drivers/hte/hte-tegra194-test.c
+++ b/drivers/hte/hte-tegra194-test.c
@@ -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);
--
2.39.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] hte: tegra: Fix missing error code in tegra_hte_test_probe()
2023-10-26 7:53 [PATCH] hte: tegra: Fix missing error code in tegra_hte_test_probe() Harshit Mogalapalli
@ 2023-10-26 23:04 ` Dipen Patel
0 siblings, 0 replies; 2+ messages in thread
From: Dipen Patel @ 2023-10-26 23:04 UTC (permalink / raw)
To: Harshit Mogalapalli, Thierry Reding, Jonathan Hunter, timestamp,
linux-tegra, linux-kernel
Cc: dan.carpenter, kernel-janitors, error27
On 10/26/23 12:53 AM, Harshit Mogalapalli wrote:
> 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>
> ---
> This is found using static analysis with smatch, only compile tested.
> ---
> drivers/hte/hte-tegra194-test.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c
> index ba37a5efbf82..ab2edff018eb 100644
> --- a/drivers/hte/hte-tegra194-test.c
> +++ b/drivers/hte/hte-tegra194-test.c
> @@ -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);
>
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-26 23:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-26 7:53 [PATCH] hte: tegra: Fix missing error code in tegra_hte_test_probe() Harshit Mogalapalli
2023-10-26 23:04 ` Dipen Patel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).