]> Git Repo - J-linux.git/commitdiff
dax: Ensure errno is returned from dax_direct_access
authorIra Weiny <[email protected]>
Tue, 25 May 2021 17:24:28 +0000 (10:24 -0700)
committerDan Williams <[email protected]>
Thu, 8 Jul 2021 05:10:04 +0000 (22:10 -0700)
If the caller specifies a negative nr_pages that is an invalid
parameter.

Return -EINVAL to ensure callers get an errno if they want to check it.

Reviewed-by: Dan Williams <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
drivers/dax/super.c

index 5fa6ae9dbc8b02b137496231b5f04175f0e5376c..44736cbd446ef747151aa1c807be368a97fbe318 100644 (file)
@@ -313,7 +313,7 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
                return -ENXIO;
 
        if (nr_pages < 0)
-               return nr_pages;
+               return -EINVAL;
 
        avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages,
                        kaddr, pfn);
This page took 0.05189 seconds and 4 git commands to generate.