public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
@ 2025-10-25 19:36 rafiqul713
  2025-10-26  8:33 ` Greg KH
  2025-10-27  7:52 ` Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: rafiqul713 @ 2025-10-25 19:36 UTC (permalink / raw)
  To: linux-staging; +Cc: rafiqul713

Signed-off-by: rafiqul713 <rafiqul713@gmail.com>
---
 drivers/staging/rtl8723bs/include/osdep_service.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h
index 8b1634f4091e..019792d0595a 100644
--- a/drivers/staging/rtl8723bs/include/osdep_service.h
+++ b/drivers/staging/rtl8723bs/include/osdep_service.h
@@ -119,6 +119,6 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size);
 /*
  * Write formatted output to sized buffer
  */
-#define rtw_sprintf(buf, size, format, arg...)	snprintf(buf, size, format, ##arg)
+#define rtw_sprintf(buf, size, fmt, ...) scnprintf(buf, size, fmt, ##__VA_ARGS__)
 
 #endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf
@ 2025-10-26  9:04 rafiqul713
  2025-10-26  9:17 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: rafiqul713 @ 2025-10-26  9:04 UTC (permalink / raw)
  To: linux-staging; +Cc: rafiqul713

From: Rafiqul Islam <rafiqul713@gmail.com>

The rtw_sprintf macro used an old-style varargs macro. Replace it with scnprintf()
to ensure buffer bounds are honoured and to align with kernel conventions.
This change is a safe refactor (no functional change) and improves robustness
against potential buffer overruns.

Tested: built driver tree (module build) and no runtime changes expected.

Signed-off-by: Rafiqul Islam <rafiqul713@gmail.com>
---
 drivers/staging/rtl8723bs/include/osdep_service.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h
index 8b1634f4091e..019792d0595a 100644
--- a/drivers/staging/rtl8723bs/include/osdep_service.h
+++ b/drivers/staging/rtl8723bs/include/osdep_service.h
@@ -119,6 +119,6 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size);
 /*
  * Write formatted output to sized buffer
  */
-#define rtw_sprintf(buf, size, format, arg...)	snprintf(buf, size, format, ##arg)
+#define rtw_sprintf(buf, size, fmt, ...) scnprintf(buf, size, fmt, ##__VA_ARGS__)
 
 #endif
-- 
2.34.1


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

end of thread, other threads:[~2025-10-27  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-25 19:36 [PATCH] staging: rtl8723bs: replace rtw_sprintf with scnprintf rafiqul713
2025-10-26  8:33 ` Greg KH
2025-10-27  7:52 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2025-10-26  9:04 rafiqul713
2025-10-26  9:17 ` Greg KH

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