Skip to content

Commit b05d4c5

Browse files
weiny2djbw
authored andcommitted
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>
1 parent 4478859 commit b05d4c5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/dax/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
313313
return -ENXIO;
314314

315315
if (nr_pages < 0)
316-
return nr_pages;
316+
return -EINVAL;
317317

318318
avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages,
319319
kaddr, pfn);

0 commit comments

Comments
 (0)