orangefs: fix error code in orangefs_sysfs_init()
Commit Message
If kzalloc() fails, error code should be ENOMEM.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/orangefs/orangefs-sysfs.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
@@ -1173,7 +1173,7 @@ static struct kobj_type stats_orangefs_ktype = {
int orangefs_sysfs_init(void)
{
- int rc = -EINVAL;
+ int rc = -ENOMEM;
gossip_debug(GOSSIP_SYSFS_DEBUG, "orangefs_sysfs_init: start\n");
@@ -1195,7 +1195,7 @@ int orangefs_sysfs_init(void)
/* create /sys/fs/orangefs/acache. */
acache_orangefs_obj = kzalloc(sizeof(*acache_orangefs_obj), GFP_KERNEL);
if (!acache_orangefs_obj) {
- rc = -EINVAL;
+ rc = -ENOMEM;
goto ofs_obj_bail;
}
@@ -1213,7 +1213,7 @@ int orangefs_sysfs_init(void)
capcache_orangefs_obj =
kzalloc(sizeof(*capcache_orangefs_obj), GFP_KERNEL);
if (!capcache_orangefs_obj) {
- rc = -EINVAL;
+ rc = -ENOMEM;
goto acache_obj_bail;
}
@@ -1230,7 +1230,7 @@ int orangefs_sysfs_init(void)
ccache_orangefs_obj =
kzalloc(sizeof(*ccache_orangefs_obj), GFP_KERNEL);
if (!ccache_orangefs_obj) {
- rc = -EINVAL;
+ rc = -ENOMEM;
goto capcache_obj_bail;
}
@@ -1246,7 +1246,7 @@ int orangefs_sysfs_init(void)
/* create /sys/fs/orangefs/ncache. */
ncache_orangefs_obj = kzalloc(sizeof(*ncache_orangefs_obj), GFP_KERNEL);
if (!ncache_orangefs_obj) {
- rc = -EINVAL;
+ rc = -ENOMEM;
goto ccache_obj_bail;
}
@@ -1263,7 +1263,7 @@ int orangefs_sysfs_init(void)
/* create /sys/fs/orangefs/perf_counters. */
pc_orangefs_obj = kzalloc(sizeof(*pc_orangefs_obj), GFP_KERNEL);
if (!pc_orangefs_obj) {
- rc = -EINVAL;
+ rc = -ENOMEM;
goto ncache_obj_bail;
}
@@ -1280,7 +1280,7 @@ int orangefs_sysfs_init(void)
/* create /sys/fs/orangefs/stats. */
stats_orangefs_obj = kzalloc(sizeof(*stats_orangefs_obj), GFP_KERNEL);
if (!stats_orangefs_obj) {
- rc = -EINVAL;
+ rc = -ENOMEM;
goto pc_obj_bail;
}