public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: ufshcd-pltfrm: Signedness bug in ufshcd_parse_clock_info()
@ 2024-08-15 11:24 Dan Carpenter
  2024-08-15 17:47 ` Bart Van Assche
  2024-08-17  1:07 ` Martin K. Petersen
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2024-08-15 11:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: James E.J. Bottomley, Martin K. Petersen, Manivannan Sadhasivam,
	Bart Van Assche, Krzysztof Kozlowski, Brian Masney, Nitin Rawat,
	Can Guo, linux-scsi, linux-kernel, kernel-janitors

The "sz" variable needs to be a signed type for the error handling to
work as intended.  Fortunately, there is some sanity checking on "sz" on
the next line, so negative values would be caught and it doesn't really
affect runtime.

Fixes: eab0dce11dd9 ("scsi: ufs: ufshcd-pltfrm: Use of_property_count_u32_elems() to get property length")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/ufs/host/ufshcd-pltfrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index 0c9b303ccfa0..1f4f30d6cb42 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -31,7 +31,7 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba)
 	const char *name;
 	u32 *clkfreq = NULL;
 	struct ufs_clk_info *clki;
-	size_t sz = 0;
+	ssize_t sz = 0;
 
 	if (!np)
 		goto out;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-17  1:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 11:24 [PATCH] scsi: ufs: ufshcd-pltfrm: Signedness bug in ufshcd_parse_clock_info() Dan Carpenter
2024-08-15 17:47 ` Bart Van Assche
2024-08-15 21:35   ` Dan Carpenter
2024-08-16  6:34     ` Manivannan Sadhasivam
2024-08-16 11:46       ` Dan Carpenter
2024-08-17  1:07 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox