aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Raynal <[email protected]>2023-12-05 08:59:36 +0100
committerMiquel Raynal <[email protected]>2023-12-14 16:43:17 +0100
commita7d84a2e7663bbe12394cc771107e04668ea313a (patch)
treebcab05c234653cc3a30c259cbaca6c895b49438c
parentb511e8e05b32d028d8369af3e369c924f98323ec (diff)
mtd: maps: vmu-flash: Fix the (mtd core) switch to ref counters
While switching to ref counters for track mtd devices use, the vmu-flash driver was forgotten. The reason for reading the ref counter seems debatable, but let's just fix the build for now. Fixes: 19bfa9ebebb5 ("mtd: use refcount to prevent corruption") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Cc: [email protected] Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
-rw-r--r--drivers/mtd/maps/vmu-flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c
index a7ec947a3ebb..53019d313db7 100644
--- a/drivers/mtd/maps/vmu-flash.c
+++ b/drivers/mtd/maps/vmu-flash.c
@@ -719,7 +719,7 @@ static int vmu_can_unload(struct maple_device *mdev)
card = maple_get_drvdata(mdev);
for (x = 0; x < card->partitions; x++) {
mtd = &((card->mtd)[x]);
- if (mtd->usecount > 0)
+ if (kref_read(&mtd->refcnt))
return 0;
}
return 1;