Skip to contentSkip to conversation

Btrfs: fix error code in btrfs_init_test_fs()

PATCH In review Dan Carpenter 2 participants 2 messages Jun 20, 2014 – Jun 23, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: fix error code in btrfs_init_test_fs()

We had intended to return a negative error code here, but we use the wrong variable so it returns success.

fs/btrfs/tests/btrfs-tests.c +1 -1
index 9626252..8e7225f 100644
@@ -65,7 +65,7 @@ int btrfs_init_test_fs(void)
 	if (IS_ERR(test_mnt)) {
 		printk(KERN_ERR "btrfs: cannot mount test file system\n");
 		unregister_filesystem(&test_type);
-		return ret;
+		return PTR_ERR(test_mnt);
 	}
 	return 0;
 }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

We had intended to return a negative error code here, but we use the wrong variable so it returns success.

Quoted 19 lines
fs/btrfs/tests/btrfs-tests.c +1 -2
index 9626252..8e7225f 100644
@@ -65,7 +65,7 @@ int btrfs_init_test_fs(void)
  	if (IS_ERR(test_mnt)) {
  		printk(KERN_ERR "btrfs: cannot mount test file system\n");
  		unregister_filesystem(&test_type);
-		return ret;
+		return PTR_ERR(test_mnt);
  	}
  	return 0;
  }
--

To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html