Re: [PATCH] dax/fsdev: fix uninitialized kaddr in fsdev_dax_zero_page_range()

From: Jonathan Cameron

Date: Mon Apr 13 2026 - 11:20:05 EST


On Sun, 12 Apr 2026 15:50:06 +0000
John Groves <john@xxxxxxxxxxxxxx> wrote:

> From: John Groves <John@xxxxxxxxxx>
>
> __fsdev_dax_direct_access() returns -EFAULT without setting *kaddr when
> dax_pgoff_to_phys() returns -1 (pgoff out of range). The return value
> was ignored, leaving kaddr uninitialized before being passed to
> fsdev_write_dax().
>
> Check the return value and propagate the error.
>
> Thanks to Dan Carpenter and the smatch project for reporting this.
>
> Signed-off-by: John Groves <john@xxxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>