]> git.ipfire.org Git - thirdparty/linux.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)
committerChristian Brauner <brauner@kernel.org>
Wed, 5 Nov 2025 13:00:16 +0000 (14:00 +0100)
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>
fs/fuse/virtio_fs.c

index 6bc7c97b017db55decefc41a402e9eefe3a3ec1b..b2f6486fe1d565c461d9fd967d56cc326bbcffd4 100644 (file)
@@ -373,7 +373,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;
                }