Commit b05d4c57 authored by Ira Weiny's avatar Ira Weiny Committed by Dan Williams

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: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20210525172428.3634316-4-ira.weiny@intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 44788591
...@@ -313,7 +313,7 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, ...@@ -313,7 +313,7 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
return -ENXIO; return -ENXIO;
if (nr_pages < 0) if (nr_pages < 0)
return nr_pages; return -EINVAL;
avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages, avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages,
kaddr, pfn); kaddr, pfn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment