mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
Merge "disp: msm: sde: add check before buffer copy"
This commit is contained in:
commit
51e3c33c7d
2 changed files with 3 additions and 0 deletions
|
|
@ -1698,6 +1698,7 @@ static ssize_t _sde_debugfs_conn_cmd_tx_sts_read(struct file *file,
|
|||
return 0;
|
||||
}
|
||||
|
||||
blen = min_t(size_t, MAX_CMD_PAYLOAD_SIZE, count);
|
||||
if (copy_to_user(buf, buffer, blen)) {
|
||||
SDE_ERROR("copy to user buffer failed\n");
|
||||
return -EFAULT;
|
||||
|
|
|
|||
|
|
@ -1102,6 +1102,7 @@ end:
|
|||
if (blen <= 0)
|
||||
return 0;
|
||||
|
||||
blen = min_t(size_t, MAX_BUFFER_SIZE, count);
|
||||
if (copy_to_user(buf, buffer, blen))
|
||||
return -EFAULT;
|
||||
|
||||
|
|
@ -1195,6 +1196,7 @@ end:
|
|||
if (blen <= 0)
|
||||
return 0;
|
||||
|
||||
blen = min_t(size_t, MAX_BUFFER_SIZE, count);
|
||||
if (copy_to_user(buf, buffer, blen))
|
||||
return -EFAULT;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue