]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
um: ubd: Initialize ubd's disk pointer in ubd_add
authorTiwei Bie <tiwei.btw@antgroup.com>
Mon, 4 Nov 2024 16:32:00 +0000 (00:32 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 7 Nov 2024 17:05:22 +0000 (18:05 +0100)
Currently, the initialization of the disk pointer in the ubd structure
is missing. It should be initialized with the allocated gendisk pointer
in ubd_add().

Fixes: 32621ad7a7ea ("ubd: remove the ubd_gendisk array")
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Link: https://patch.msgid.link/20241104163203.435515-2-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/drivers/ubd_kern.c

index 2b8d04e67600ad7fcbff0d2f1f998f009a20a8b5..f19173da64d83c0a1cadc625daf51328cb1088cd 100644 (file)
@@ -898,6 +898,8 @@ static int ubd_add(int n, char **error_out)
        if (err)
                goto out_cleanup_disk;
 
+       ubd_dev->disk = disk;
+
        return 0;
 
 out_cleanup_disk: