bdev_open() calls try_module_get(disk->fops->owner) and bdev_release()
calls module_put(disk->fops->owner). swim3 can be built as a module
(CONFIG_MAC_FLOPPY), though it currently lacks a module_exit() handler.

Set .owner = THIS_MODULE in floppy_fops for consistency with other
block_device_operations definitions and to prepare for annotating
struct block_device_operations::owner with Clang's
require_explicit_initialization attribute.

Signed-off-by: Ian Rogers <[email protected]>
---
Note: Found using Clang's require_explicit_initialization attribute;
an AI coding assistant helped audit call sites, verify Fixes commits,
and draft the changelog.

 drivers/block/swim3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index a03de4c4d35f..898a5e642c80 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1068,6 +1068,7 @@ static int floppy_revalidate(struct gendisk *disk)
 }
 
 static const struct block_device_operations floppy_fops = {
+       .owner          = THIS_MODULE,
        .open           = floppy_unlocked_open,
        .release        = floppy_release,
        .ioctl          = floppy_ioctl,

base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.56.1.839.g22a8290db9-goog


Reply via email to