]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
virtio-fs: fix incorrect check for fsvq->kobj
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Mon, 27 Oct 2025 10:46:47 +0000 (03:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Nov 2025 09:35:57 +0000 (10:35 +0100)
[ Upstream commit c014021253d77cd89b2d8788ce522283d83fbd40 ]

In virtio_fs_add_queues_sysfs(), the code incorrectly checks fs->mqs_kobj
after calling kobject_create_and_add(). Change the check to fsvq->kobj
(fs->mqs_kobj -> fsvq->kobj) to ensure the per-queue kobject is
successfully created.

Fixes: 87cbdc396a31 ("virtio_fs: add sysfs entries for queue information")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20251027104658.1668537-1-alok.a.tiwari@oracle.com
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fuse/virtio_fs.c

index 749c9f66d74c6da51f7bb091e86c9705d95484c2..c81f7b888c38528d934c361cd6e87285a088e483 100644 (file)
@@ -372,7 +372,7 @@ static int virtio_fs_add_queues_sysfs(struct virtio_fs *fs)
 
                sprintf(buff, "%d", i);
                fsvq->kobj = kobject_create_and_add(buff, fs->mqs_kobj);
-               if (!fs->mqs_kobj) {
+               if (!fsvq->kobj) {
                        ret = -ENOMEM;
                        goto out_del;
                }