mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
mtd: maps: vmu-flash: Fix the (mtd core) switch to ref counters
commita7d84a2e76upstream. 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:19bfa9ebeb("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a979f56aa4
commit
38c12f1099
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user