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 <[email protected]> Signed-off-by: Ira Weiny <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 4478859 commit b05d4c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)