From: Jie Liu <jeff....@oracle.com>

Return the actual error code if call kset_create_and_add() failed

Cc: Chris Mason <c...@fb.com>
Cc: Josef Bacik <jba...@fb.com>
Signed-off-by: Jie Liu <jeff....@oracle.com>
---
 fs/btrfs/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index df39458..8f7dfa7 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -705,8 +705,8 @@ int btrfs_init_sysfs(void)
        int ret;
 
        btrfs_kset = kset_create_and_add("btrfs", NULL, fs_kobj);
-       if (!btrfs_kset)
-               return -ENOMEM;
+       if (IS_ERR(btrfs_kset))
+               return PTR_ERR(btrfs_kset);
 
        ret = btrfs_init_debugfs();
        if (ret)
-- 
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to