Skip to content

Commit 0e853d2

Browse files
rpembryUlrich Hecht
authored andcommitted
9p: sysfs_init: don't hardcode error to ENOMEM
[ Upstream commit 528f218b31aac4bbfc58914d43766a22ab545d48 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent db3a754 commit 0e853d2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

fs/9p/v9fs.c

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

610610
static int __init v9fs_sysfs_init(void)
611611
{
612+
int ret;
613+
612614
v9fs_kobj = kobject_create_and_add("9p", fs_kobj);
613615
if (!v9fs_kobj)
614616
return -ENOMEM;
615617

616-
if (sysfs_create_group(v9fs_kobj, &v9fs_attr_group)) {
618+
ret = sysfs_create_group(v9fs_kobj, &v9fs_attr_group);
619+
if (ret) {
617620
kobject_put(v9fs_kobj);
618-
return -ENOMEM;
621+
return ret;
619622
}
620623

621624
return 0;

0 commit comments

Comments
 (0)