mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
Merge "soc: Fix out of bounds access in register show function"
This commit is contained in:
commit
d7c16ff4f4
1 changed files with 5 additions and 0 deletions
|
|
@ -144,6 +144,11 @@ static ssize_t swrm_reg_show(char __user *ubuf, size_t count,
|
|||
i <= SWR_MSTR_MAX_REG_ADDR; i += 4) {
|
||||
reg_val = dbgswrm->read(dbgswrm->handle, i);
|
||||
len = snprintf(tmp_buf, 25, "0x%.3x: 0x%.2x\n", i, reg_val);
|
||||
if (len < 0) {
|
||||
pr_err("%s: fail to fill the buffer\n", __func__);
|
||||
total = -EFAULT;
|
||||
goto copy_err;
|
||||
}
|
||||
if ((total + len) >= count - 1)
|
||||
break;
|
||||
if (copy_to_user((ubuf + total), tmp_buf, len)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue