mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
d/psvr: Fix use after free of timekeeping
This commit is contained in:
parent
b33811930b
commit
76445c8fe9
|
@ -875,8 +875,6 @@ teardown(struct psvr_device *psvr)
|
|||
// Stop the variable tracking.
|
||||
u_var_remove_root(psvr);
|
||||
|
||||
time_state_destroy(psvr->timekeeping);
|
||||
|
||||
// Includes null check, and sets to null.
|
||||
xrt_tracked_psvr_destroy(&psvr->tracker);
|
||||
|
||||
|
@ -895,6 +893,15 @@ teardown(struct psvr_device *psvr)
|
|||
hid_close(psvr->hmd_handle);
|
||||
psvr->hmd_handle = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* This needs to happen last because when waiting for
|
||||
* device control changes we can get IMU update packets.
|
||||
*/
|
||||
if (psvr->timekeeping != NULL) {
|
||||
time_state_destroy(psvr->timekeeping);
|
||||
psvr->timekeeping = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue