summaryrefslogtreecommitdiff
path: root/drivers/mtd/mtdcore.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2023-06-20 16:19:04 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-07-12 14:30:08 +0300
commit19bfa9ebebb5ec0695def57eb1d80de7e9cab369 (patch)
treefa26bdecb34162685d5dfeee7ef9d442d7345f9c /drivers/mtd/mtdcore.h
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 (diff)
downloadlinux-19bfa9ebebb5ec0695def57eb1d80de7e9cab369.tar.xz
mtd: use refcount to prevent corruption
When underlying device is removed mtd core will crash in case user space is holding open handle. Need to use proper refcounting so device is release only when has no users. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230620131905.648089-2-alexander.usyskin@intel.com
Diffstat (limited to 'drivers/mtd/mtdcore.h')
-rw-r--r--drivers/mtd/mtdcore.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.h b/drivers/mtd/mtdcore.h
index b5eefeabf310..b014861a06a6 100644
--- a/drivers/mtd/mtdcore.h
+++ b/drivers/mtd/mtdcore.h
@@ -12,6 +12,7 @@ int __must_check add_mtd_device(struct mtd_info *mtd);
int del_mtd_device(struct mtd_info *mtd);
int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
int del_mtd_partitions(struct mtd_info *);
+void release_mtd_partition(struct mtd_info *mtd);
struct mtd_partitions;