Skip to content

Commit a7d84a2

Browse files
committed
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: 19bfa9e ("mtd: use refcount to prevent corruption") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202312022315.79twVRZw-lkp@intel.com/ Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231205075936.13831-1-miquel.raynal@bootlin.com
1 parent b511e8e commit a7d84a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/maps/vmu-flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static int vmu_can_unload(struct maple_device *mdev)
719719
card = maple_get_drvdata(mdev);
720720
for (x = 0; x < card->partitions; x++) {
721721
mtd = &((card->mtd)[x]);
722-
if (mtd->usecount > 0)
722+
if (kref_read(&mtd->refcnt))
723723
return 0;
724724
}
725725
return 1;

0 commit comments

Comments
 (0)