Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: ti-st: st_kim: Fix use after free bug in kim_remove due to race…
… condition In kim_probe, it called st_core_init and bound &st_gdata->work_write_wakeup with work_fn_write_wakeup. When it calls st_tty_wakeup, it will finally call schedule_work to start the work. When we call kim_remove to remove the driver, there may be a sequence as follows: Fix it by finishing the work before cleanup in kim_remove CPU0 CPU1 |work_fn_write_wakeup kim_remove | st_core_exit | kfree(st_gdata)| |st_tx_wakeup |//use st_gdata Fixes: b05b7c7 ("ti-st: use worker instead of calling st_int_write in wake up") Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
- Loading branch information