mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
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
This commit is contained in:
committed by
Miquel Raynal
parent
06c2afb862
commit
19bfa9ebeb
@@ -379,7 +379,7 @@ struct mtd_info {
|
||||
|
||||
struct module *owner;
|
||||
struct device dev;
|
||||
int usecount;
|
||||
struct kref refcnt;
|
||||
struct mtd_debug_info dbg;
|
||||
struct nvmem_device *nvmem;
|
||||
struct nvmem_device *otp_user_nvmem;
|
||||
|
||||
Reference in New Issue
Block a user