)]}' { "commit": "7cc06ea5c7c3b36801421a6be17b51b92c1bc05a", "tree": "df2c60fd63f49cebf0256513e7288c1ad296422c", "parents": [ "c3639bc23eaaed7fa94d377af42f00ddc5083de2" ], "author": { "name": "Benjamin Berg", "email": "bberg@redhat.com", "time": "Tue Feb 15 11:13:41 2022 +0100" }, "committer": { "name": "Tormod Volden", "email": "debian.tormod@gmail.com", "time": "Wed Mar 16 17:52:51 2022 +0100" }, "message": "io: Track device in usbi_transfer\n\ntransfer-\u003edev_handle currently has the behaviour that it will be unset\nif the device is closed. The sync API uses this fact to catch an error\ncase.\n\nIn other cases, transfer-\u003edev_handle will keep its value, which means\nthat if the transfer lives longer than the device handle, the pointer\nbecomes invalid.\n\nThe transfer does however keep a reference to the device, which owns the\npointer to the context. As such, we can track this reference internal to\nthe transfer, and it is set while the transfer is in-flight.\n\nWith this, switch the logging infrastructure to use itransfer-\u003edev-\u003ectx\nwhile checking that itransfer-\u003edev is non-NULL.\n\nNote that this was a regression caused by 6cae9c6 (\"core: update\nusbi_dbg to take the context as an argument\"), specifically when\nresolving the context while freeing a transfer after closing a device.\n\nNote that the transfer will now keep a reference to the device until it\nis free\u0027ed. This allows it to use the correct context for logging even\nin libusb_free_transfer.\n\nThe alternative to all this would be to just explicitly pass NULL to the\nlog handler in libusb_free_transfer.\n\nFixes #1038\nCloses #1073\n", "tree_diff": [ { "type": "modify", "old_id": "0d2ac9ea290679c29a0630ea7515f66af30c48df", "old_mode": 33188, "old_path": "libusb/io.c", "new_id": "b919e9d91cd21350b700d9e31f7e03ad6956f09a", "new_mode": 33188, "new_path": "libusb/io.c" }, { "type": "modify", "old_id": "158a9af5846e38bd2be2e3d4192a52dc5a25beaa", "old_mode": 33188, "old_path": "libusb/libusbi.h", "new_id": "7618236f9b3a9155d9a632b89000195951410cc4", "new_mode": 33188, "new_path": "libusb/libusbi.h" }, { "type": "modify", "old_id": "2b170fce4a37021c5f789c69b2804c692940bc30", "old_mode": 33188, "old_path": "libusb/version_nano.h", "new_id": "7bf6ace79a5a6dec757f268ba14208347095cfa4", "new_mode": 33188, "new_path": "libusb/version_nano.h" } ] }