mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
soc: qcom: ramdump: Fix the missed unmap of mapped memory
Before copying dump to userspace, memory is mapped and then the content get copied to userspace and later that memory should be unmapped. Let's unmap the memory after the content get copied to userspace. Change-Id: I03d53ebd1cdb743e1820f226a49d46136eca4874 Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
This commit is contained in:
parent
bac14d76ca
commit
75ae7139bd
1 changed files with 4 additions and 0 deletions
|
|
@ -262,6 +262,8 @@ static ssize_t ramdump_read(struct file *filep, char __user *buf, size_t count,
|
|||
}
|
||||
|
||||
kfree(finalbuf);
|
||||
if (!vaddr && origdevice_mem)
|
||||
iounmap(origdevice_mem);
|
||||
|
||||
*pos += copy_size;
|
||||
|
||||
|
|
@ -275,6 +277,8 @@ static ssize_t ramdump_read(struct file *filep, char __user *buf, size_t count,
|
|||
ramdump_done:
|
||||
srcu_read_unlock(&rd_dev->rd_srcu, srcu_idx);
|
||||
kfree(finalbuf);
|
||||
if (!vaddr && origdevice_mem)
|
||||
iounmap(origdevice_mem);
|
||||
*pos = 0;
|
||||
reset_ramdump_entry(entry);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue