Merge "iommu: iommu-debug: don't pass null character to copy_to_user"
This commit is contained in:
commit
2c57e25f25
1 changed files with 5 additions and 5 deletions
|
@ -1403,7 +1403,7 @@ static ssize_t iommu_debug_virt_addr_read(struct file *file, char __user *ubuf,
|
||||||
else
|
else
|
||||||
snprintf(buf, 100, "0x%pK\n", virt_addr);
|
snprintf(buf, 100, "0x%pK\n", virt_addr);
|
||||||
|
|
||||||
buflen = min(count, strlen(buf)+1);
|
buflen = min(count, strlen(buf));
|
||||||
if (copy_to_user(ubuf, buf, buflen)) {
|
if (copy_to_user(ubuf, buf, buflen)) {
|
||||||
pr_err("Couldn't copy_to_user\n");
|
pr_err("Couldn't copy_to_user\n");
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
|
@ -1527,7 +1527,7 @@ static ssize_t iommu_debug_pte_read(struct file *file, char __user *ubuf,
|
||||||
else
|
else
|
||||||
snprintf(buf, 100, "pte=%016llx\n", pte);
|
snprintf(buf, 100, "pte=%016llx\n", pte);
|
||||||
|
|
||||||
buflen = min(count, strlen(buf)+1);
|
buflen = min(count, strlen(buf));
|
||||||
if (copy_to_user(ubuf, buf, buflen)) {
|
if (copy_to_user(ubuf, buf, buflen)) {
|
||||||
pr_err("Couldn't copy_to_user\n");
|
pr_err("Couldn't copy_to_user\n");
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
|
@ -1596,7 +1596,7 @@ static ssize_t iommu_debug_atos_read(struct file *file, char __user *ubuf,
|
||||||
snprintf(buf, 100, "%pa\n", &phys);
|
snprintf(buf, 100, "%pa\n", &phys);
|
||||||
}
|
}
|
||||||
|
|
||||||
buflen = min(count, strlen(buf)+1);
|
buflen = min(count, strlen(buf));
|
||||||
if (copy_to_user(ubuf, buf, buflen)) {
|
if (copy_to_user(ubuf, buf, buflen)) {
|
||||||
pr_err("Couldn't copy_to_user\n");
|
pr_err("Couldn't copy_to_user\n");
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
|
@ -1649,7 +1649,7 @@ static ssize_t iommu_debug_dma_atos_read(struct file *file, char __user *ubuf,
|
||||||
else
|
else
|
||||||
snprintf(buf, 100, "%pa\n", &phys);
|
snprintf(buf, 100, "%pa\n", &phys);
|
||||||
|
|
||||||
buflen = min(count, strlen(buf)+1);
|
buflen = min(count, strlen(buf));
|
||||||
if (copy_to_user(ubuf, buf, buflen)) {
|
if (copy_to_user(ubuf, buf, buflen)) {
|
||||||
pr_err("Couldn't copy_to_user\n");
|
pr_err("Couldn't copy_to_user\n");
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
|
@ -1880,7 +1880,7 @@ static ssize_t iommu_debug_dma_map_read(struct file *file, char __user *ubuf,
|
||||||
iova = ddev->iova;
|
iova = ddev->iova;
|
||||||
snprintf(buf, 100, "%pa\n", &iova);
|
snprintf(buf, 100, "%pa\n", &iova);
|
||||||
|
|
||||||
buflen = min(count, strlen(buf)+1);
|
buflen = min(count, strlen(buf));
|
||||||
if (copy_to_user(ubuf, buf, buflen)) {
|
if (copy_to_user(ubuf, buf, buflen)) {
|
||||||
pr_err("Couldn't copy_to_user\n");
|
pr_err("Couldn't copy_to_user\n");
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue