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

Commit e54b71eb authored by Sujeev Dias's avatar Sujeev Dias
Browse files

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: default avatarSujeev Dias <sdias@codeaurora.org>
parent a3c82028
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);