Skip to content

Commit 528f218

Browse files
rpembrymartinetd
authored andcommitted
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>
1 parent 86db0c3 commit 528f218

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/9p/v9fs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,16 @@ static const struct attribute_group v9fs_attr_group = {
596596

597597
static int __init v9fs_sysfs_init(void)
598598
{
599+
int ret;
600+
599601
v9fs_kobj = kobject_create_and_add("9p", fs_kobj);
600602
if (!v9fs_kobj)
601603
return -ENOMEM;
602604

603-
if (sysfs_create_group(v9fs_kobj, &v9fs_attr_group)) {
605+
ret = sysfs_create_group(v9fs_kobj, &v9fs_attr_group);
606+
if (ret) {
604607
kobject_put(v9fs_kobj);
605-
return -ENOMEM;
608+
return ret;
606609
}
607610

608611
return 0;

0 commit comments

Comments
 (0)