]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dax/fsdev: fix uninitialized kaddr in fsdev_dax_zero_page_range()
authorJohn Groves <John@Groves.net>
Sun, 12 Apr 2026 15:50:06 +0000 (15:50 +0000)
committerIra Weiny <ira.weiny@intel.com>
Mon, 13 Apr 2026 19:15:15 +0000 (14:15 -0500)
commit45df9111692c62d5f09fc4345ae36dae31024797
tree9fa60fc31ffe4ed3190193310eff7f721f0e27b8
parent2ae624d5a555d47a735fb3f4d850402859a4db77
dax/fsdev: fix uninitialized kaddr in fsdev_dax_zero_page_range()

__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@groves.net>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/0100019d8262cda2-9714d31c-8fc1-4ca5-b32d-4df678240d14-000000@email.amazonses.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
drivers/dax/fsdev.c