Commit caf9ead2 authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Kalle Valo

wifi: mwifiex: prefer strscpy() over strlcpy()

Prefer 'strscpy()' over 'strlcpy()' in 'mwifiex_init_hw_fw()'.
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230629085115.180499-1-dmantipov@yandex.ru
parent 4831a809
...@@ -724,14 +724,9 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter, ...@@ -724,14 +724,9 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter,
/* Override default firmware with manufacturing one if /* Override default firmware with manufacturing one if
* manufacturing mode is enabled * manufacturing mode is enabled
*/ */
if (mfg_mode) { if (mfg_mode)
if (strlcpy(adapter->fw_name, MFG_FIRMWARE, strscpy(adapter->fw_name, MFG_FIRMWARE,
sizeof(adapter->fw_name)) >= sizeof(adapter->fw_name));
sizeof(adapter->fw_name)) {
pr_err("%s: fw_name too long!\n", __func__);
return -1;
}
}
if (req_fw_nowait) { if (req_fw_nowait) {
ret = request_firmware_nowait(THIS_MODULE, 1, adapter->fw_name, ret = request_firmware_nowait(THIS_MODULE, 1, adapter->fw_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment