mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
mtd: blkdevs: fix crash related to sysfs attributes.
Remove the attributes group before disk to avoid use after free Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
ef41e1bb11
commit
dba76c033f
@ -410,13 +410,14 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
|
||||
BUG();
|
||||
}
|
||||
|
||||
/* Stop new requests to arrive */
|
||||
del_gendisk(old->disk);
|
||||
|
||||
if (old->disk_attributes)
|
||||
sysfs_remove_group(&disk_to_dev(old->disk)->kobj,
|
||||
old->disk_attributes);
|
||||
|
||||
/* Stop new requests to arrive */
|
||||
del_gendisk(old->disk);
|
||||
|
||||
|
||||
/* Stop the thread */
|
||||
kthread_stop(old->thread);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user