summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-01-16 17:54:33 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2025-01-16 17:54:33 +0100
commited8fd8d5dd4aa250e18152b80cbac24de7335488 (patch)
tree415f562bcd76df844ac76d044418179460b3b0fa /fs
parentMerge tag 'seccomp-v6.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
parentbtrfs: add the missing error handling inside get_canonical_dev_path (diff)
downloadlinux-ed8fd8d5dd4aa250e18152b80cbac24de7335488.tar.xz
linux-ed8fd8d5dd4aa250e18152b80cbac24de7335488.zip
Merge tag 'for-6.13-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fix from David Sterba: - handle d_path() errors when canonicalizing device mapper paths during device scan * tag 'for-6.13-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: add the missing error handling inside get_canonical_dev_path
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1cccaf9c2b0d..3d0ac8bdb21f 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -797,6 +797,10 @@ static int get_canonical_dev_path(const char *dev_path, char *canonical)
if (ret)
goto out;
resolved_path = d_path(&path, path_buf, PATH_MAX);
+ if (IS_ERR(resolved_path)) {
+ ret = PTR_ERR(resolved_path);
+ goto out;
+ }
ret = strscpy(canonical, resolved_path, PATH_MAX);
out:
kfree(path_buf);