summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs/hal
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna3@gmail.com>2018-02-27 23:44:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-01 17:21:49 +0100
commit2d42ac21efe4a191f992ffd2d004b0a4e052102e (patch)
treec9a8809e4db41ed9b234c42a98dc0f6f9b7fc10e /drivers/staging/rtl8723bs/hal
parentbafc56491bf3ec090994fc3a2451ec3c68d5bc1b (diff)
downloadlinux-2d42ac21efe4a191f992ffd2d004b0a4e052102e.tar.gz
linux-2d42ac21efe4a191f992ffd2d004b0a4e052102e.tar.bz2
linux-2d42ac21efe4a191f992ffd2d004b0a4e052102e.zip
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: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs/hal')
-rw-r--r--drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index d6cef9e8378d..0ce9b47d644d 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -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) {