VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   35 Branches   59 Tags
author: Qu Wenruo <wqu@suse.com> 2021-08-06 18:24:15 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-09-03 10:23:06 +0200 commit: 301aabe0239f227818622096be7e180fcdbedf80 parent: 8e2112d600b2c0152c5a75e4c61fbae6b619af61
Commit Summary:
btrfs: fix NULL pointer dereference when deleting device by invalid id
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9f723b744863..7d5875824be7 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2137,7 +2137,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path,
 
 	if (IS_ERR(device)) {
 		if (PTR_ERR(device) == -ENOENT &&
-		    strcmp(device_path, "missing") == 0)
+		    device_path && strcmp(device_path, "missing") == 0)
 			ret = BTRFS_ERROR_DEV_MISSING_NOT_FOUND;
 		else
 			ret = PTR_ERR(device);