Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d42ac21 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: use kmemdup for allocation and copy



Use kmemdup instead of kzalloc and memcpy to simplify the code.
Issue found with coccicheck.

Signed-off-by: default avatarDafna Hirschfeld <dafna3@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bafc5649
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -433,13 +433,12 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
		goto exit;
	}

	pFirmware->szFwBuffer = kzalloc(fw->size, GFP_KERNEL);
	pFirmware->szFwBuffer = kmemdup(fw->data, fw->size, GFP_KERNEL);
	if (!pFirmware->szFwBuffer) {
		rtStatus = _FAIL;
		goto exit;
	}

	memcpy(pFirmware->szFwBuffer, fw->data, fw->size);
	pFirmware->ulFwLength = fw->size;
	release_firmware(fw);
	if (pFirmware->ulFwLength > FW_8723B_SIZE) {