diff mbox

Btrfs: fix error code in btrfs_init_test_fs()

Message ID 20140620192010.GB19824@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter June 20, 2014, 7:20 p.m. UTC
We had intended to return a negative error code here, but we use the
wrong variable so it returns success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Comments

Satoru Takeuchi June 23, 2014, 1:30 a.m. UTC | #1
(2014/06/21 4:20), Dan Carpenter wrote:
> We had intended to return a negative error code here, but we use the
> wrong variable so it returns success.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

>
> diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
> index 9626252..8e7225f 100644
> --- a/fs/btrfs/tests/btrfs-tests.c
> +++ b/fs/btrfs/tests/btrfs-tests.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

Patch

diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index 9626252..8e7225f 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -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;
 }