linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] [v4] wifi: mwifiex: prefer strscpy() over strlcpy()
@ 2023-06-29  8:51 Dmitry Antipov
  2023-06-29  8:51 ` [PATCH 2/3] [v4] wifi: mwifiex: fix fortify warning Dmitry Antipov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Dmitry Antipov @ 2023-06-29  8:51 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Brian Norris, linux-wireless, Dmitry Antipov

Prefer 'strscpy()' over 'strlcpy()' in 'mwifiex_init_hw_fw()'.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
v4: simplify to drop strlcpy() only (Brian Norris)
---
 drivers/net/wireless/marvell/mwifiex/main.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index ea22a08e6c08..64512b00e8b5 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -724,14 +724,9 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter,
 	/* Override default firmware with manufacturing one if
 	 * manufacturing mode is enabled
 	 */
-	if (mfg_mode) {
-		if (strlcpy(adapter->fw_name, MFG_FIRMWARE,
-			    sizeof(adapter->fw_name)) >=
-			    sizeof(adapter->fw_name)) {
-			pr_err("%s: fw_name too long!\n", __func__);
-			return -1;
-		}
-	}
+	if (mfg_mode)
+		strscpy(adapter->fw_name, MFG_FIRMWARE,
+			sizeof(adapter->fw_name));
 
 	if (req_fw_nowait) {
 		ret = request_firmware_nowait(THIS_MODULE, 1, adapter->fw_name,
-- 
2.41.0


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

end of thread, other threads:[~2023-07-25 15:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-29  8:51 [PATCH 1/3] [v4] wifi: mwifiex: prefer strscpy() over strlcpy() Dmitry Antipov
2023-06-29  8:51 ` [PATCH 2/3] [v4] wifi: mwifiex: fix fortify warning Dmitry Antipov
2023-06-29 19:52   ` Brian Norris
2023-06-29  8:51 ` [PATCH 3/3] [v4] wifi: mwifiex: drop BUG_ON() from TX error handling Dmitry Antipov
2023-06-29 19:16   ` Simon Horman
2023-06-29 20:12   ` Brian Norris
2023-06-29 19:50 ` [PATCH 1/3] [v4] wifi: mwifiex: prefer strscpy() over strlcpy() Brian Norris
2023-07-25 15:14 ` Kalle Valo

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).