mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mhi: core: use kmemdup rather than duplicating it's implementation
Use kmemdup, instead of using kmalloc, and memcpy combo. CRs-Fixed: 2258358 Change-Id: I941ee2fa3a4b47dd0a2a5833ee52445a553f3aa6 Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
This commit is contained in:
parent
a3c82028fa
commit
e54b71ebbf
@ -506,7 +506,7 @@ void mhi_fw_load_worker(struct work_struct *work)
|
||||
if (size > firmware->size)
|
||||
size = firmware->size;
|
||||
|
||||
buf = kmalloc(size, GFP_KERNEL);
|
||||
buf = kmemdup(firmware->data, size, GFP_KERNEL);
|
||||
if (!buf) {
|
||||
MHI_ERR("Could not allocate memory for image\n");
|
||||
release_firmware(firmware);
|
||||
@ -514,7 +514,6 @@ void mhi_fw_load_worker(struct work_struct *work)
|
||||
}
|
||||
|
||||
/* load sbl image */
|
||||
memcpy(buf, firmware->data, size);
|
||||
ret = mhi_fw_load_sbl(mhi_cntrl, buf, size);
|
||||
kfree(buf);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user