Commit 528f218b authored by Randall P. Embry's avatar Randall P. Embry Committed by Dominique Martinet
Browse files

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: default avatarRandall P. Embry <rpembry@gmail.com>
Message-ID: <20250926-v9fs_misc-v1-3-a8b3907fc04d@codewreck.org>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent 86db0c32
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;