Message ID | 20210917094241.232168-1-deng.changcheng@zte.com.cn (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [linux-next] net: wwan: iosm: use kmemdup instead of kzalloc and memcpy | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply |
diff --git a/drivers/net/wwan/iosm/iosm_ipc_flash.c b/drivers/net/wwan/iosm/iosm_ipc_flash.c index a43aafc70168..3d2f1ec6da00 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_flash.c +++ b/drivers/net/wwan/iosm/iosm_ipc_flash.c @@ -430,11 +430,10 @@ int ipc_flash_boot_psi(struct iosm_devlink *ipc_devlink, int ret; dev_dbg(ipc_devlink->dev, "Boot transfer PSI"); - psi_code = kzalloc(fw->size, GFP_KERNEL); + psi_code = kmemdup(fw->data, fw->size, GFP_KERNEL); if (!psi_code) return -ENOMEM; - memcpy(psi_code, fw->data, fw->size); ret = ipc_imem_sys_devlink_write(ipc_devlink, psi_code, fw->size); if (ret) { dev_err(ipc_devlink->dev, "RPSI Image write failed");