mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 08:58:07 +00:00
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:
parent
4831a80908
commit
caf9ead2c7
1 changed files with 3 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue