summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall P. Embry <rpembry@gmail.com>2025-09-26 18:27:31 +0900
committerDominique Martinet <asmadeus@codewreck.org>2025-09-27 21:44:38 +0900
commit528f218b31aac4bbfc58914d43766a22ab545d48 (patch)
tree09072dbb487d914e0b57304e61e8495fc77b4b62
parent86db0c32f16c5538ddb740f54669ace8f3a1f3d7 (diff)
9p: sysfs_init: don't hardcode error to ENOMEM
v9fs_sysfs_init() always returned -ENOMEM on failure; return the actual sysfs_create_group() error instead. Signed-off-by: Randall P. Embry <rpembry@gmail.com> Message-ID: <20250926-v9fs_misc-v1-3-a8b3907fc04d@codewreck.org> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
-rw-r--r--fs/9p/v9fs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 4d289c56578f..a020a8f00a1a 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -596,13 +596,16 @@ static const struct attribute_group v9fs_attr_group = {
static int __init v9fs_sysfs_init(void)
{
+ int ret;
+
v9fs_kobj = kobject_create_and_add("9p", fs_kobj);
if (!v9fs_kobj)
return -ENOMEM;
- if (sysfs_create_group(v9fs_kobj, &v9fs_attr_group)) {
+ ret = sysfs_create_group(v9fs_kobj, &v9fs_attr_group);
+ if (ret) {
kobject_put(v9fs_kobj);
- return -ENOMEM;
+ return ret;
}
return 0;