lib: Cancel pending timeouts on close

So that the drivers don't call back into themselves once freed.
This commit is contained in:
Bastien Nocera 2018-09-27 14:48:07 +02:00
parent 948a67a51f
commit 44c3f4f772

View file

@ -93,6 +93,7 @@ void fpi_drvcb_close_complete(struct fp_dev *dev)
G_DEBUG_HERE();
BUG_ON(dev->state != DEV_STATE_DEINITIALIZING);
dev->state = DEV_STATE_DEINITIALIZED;
fpi_timeout_cancel_all_for_dev(dev);
libusb_close(dev->udev);
if (dev->close_cb)
dev->close_cb(dev, dev->close_cb_data);