summaryrefslogtreecommitdiffstats
path: root/drivers/dax/super.c
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2021-05-25 19:24:28 +0200
committerDan Williams <dan.j.williams@intel.com>2021-07-08 07:10:04 +0200
commitb05d4c576b697b9f462b9c532c997171d5c3b067 (patch)
tree78caf3c0f16a323d5aca440d72d20e1917be6514 /drivers/dax/super.c
parentfs/dax: Clarify nr_pages to dax_direct_access() (diff)
downloadlinux-b05d4c576b697b9f462b9c532c997171d5c3b067.tar.xz
linux-b05d4c576b697b9f462b9c532c997171d5c3b067.zip
dax: Ensure errno is returned from dax_direct_access
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 <dan.j.williams@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20210525172428.3634316-4-ira.weiny@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax/super.c')
-rw-r--r--drivers/dax/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 5fa6ae9dbc8b..44736cbd446e 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -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);