提交 dba76c03 编写于 作者: M Maxim Levitsky 提交者: David Woodhouse

mtd: blkdevs: fix crash related to sysfs attributes.

Remove the attributes group before disk to avoid use after free
Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 ef41e1bb
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册