Commit ed8fd8d5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 619f0b6f fe4de594
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);