OSDN Git Service

iommu/iommu-debug: Fix parsing of unmap size
authorMitchel Humpherys <mitchelh@codeaurora.org>
Wed, 29 Jul 2015 19:45:29 +0000 (12:45 -0700)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:13:41 +0000 (11:13 -0700)
The unmap debugfs file write handler is currently incorrectly parsing
the size to be unmapped (storing the IOVA as the size).  Fix this by
parsing from the correct offset (just after the first comma).

Change-Id: I438851882052acc511c713706bc4f0cbf373353e
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
drivers/iommu/iommu-debug.c

index f775544..de7ffa7 100644 (file)
@@ -716,7 +716,7 @@ static ssize_t iommu_debug_unmap_write(struct file *file,
        if (kstrtou64(buf, 0, &iova))
                goto invalid_format;
 
-       if (kstrtoul(buf, 0, &size))
+       if (kstrtoul(comma1 + 1, 0, &size))
                goto invalid_format;
 
        unmapped = iommu_unmap(ddev->domain, iova, size);