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

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

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230629085115.180499-1-dmantipov@yandex.ru
This commit is contained in:
Dmitry Antipov 2023-06-29 11:51:00 +03:00 committed by Kalle Valo
parent 4831a80908
commit caf9ead2c7

View file

@ -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,