)]}'
{"id":"openocd~master~Id1818c8af7cf0d4d17dfa1d22aad079da01ef740","project":"openocd","branch":"master","hashtags":[],"change_id":"Id1818c8af7cf0d4d17dfa1d22aad079da01ef740","subject":"stlink: fix SIGSEGV with libusb v1.0.24-33-g32a2206 (11618)","status":"MERGED","created":"2021-06-23 15:36:56.000000000","updated":"2021-06-27 13:57:43.000000000","submitted":"2021-06-27 13:57:43.000000000","submitter":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"total_comment_count":0,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"6331-1624802263574-c6aec61d","meta_rev_id":"742743edc35de5607c14aa309cefb5429750f736","_number":6331,"owner":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},{"value":0,"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},{"value":0,"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"value":0,"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},{"value":0,"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},{"value":0,"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},{"value":1,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Code-Review":{"approved":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"all":[{"value":1,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},{"value":1,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},{"value":1,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":1,"max":2},"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"value":2,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},{"value":1,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":1,"max":2},"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},{"value":2,"date":"2021-06-27 13:57:43.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},{"value":0,"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2021-06-23 16:08:43.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2021-06-23 19:30:33.000000000","updated_by":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"reviewer":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"state":"REVIEWER"},{"updated":"2021-06-24 02:25:53.000000000","updated_by":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"reviewer":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"state":"REVIEWER"},{"updated":"2021-06-24 06:44:49.000000000","updated_by":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"reviewer":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"state":"REVIEWER"},{"updated":"2021-06-24 06:47:20.000000000","updated_by":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"reviewer":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"state":"REVIEWER"},{"updated":"2021-06-26 21:02:19.000000000","updated_by":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"reviewer":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"state":"REVIEWER"}],"messages":[{"id":"5a773fc31038d137f49c2d3ff006514f13199262","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-06-23 15:36:56.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"4df6ab2ef71751f52e24b1f1b6feda35a87aec45","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-06-23 16:08:43.000000000","message":"Patch Set 1: Verified+1\n\nBuild Successful \n\nhttp://build.openocd.org/job/openocd-gerrit/14794/ : SUCCESS\n\nhttp://build.openocd.org/job/openocd-gerrit-build/14040/ : SUCCESS","accounts_in_message":[],"_revision_number":1},{"id":"06f969d08c72985f60d85dd88c65be368dd72792","author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"real_author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"date":"2021-06-23 19:30:33.000000000","message":"Patch Set 1: Code-Review+1","accounts_in_message":[],"_revision_number":1},{"id":"e96413675a6e4bd5ee3e8f09a8ab7dc615bca7fa","author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"real_author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"date":"2021-06-23 23:36:41.000000000","message":"Patch Set 1:\n\nIt\u0027s perfectly fine, and the normal usage, to pass NULL as the libusb context. *But* that requires that the first call to libusb_init() doesn\u0027t specify a non default context.\n\nI don\u0027t see any reason for libusb_helper to *not* simply use the default context and pass NULL to libusb_init() and everywhere else.","accounts_in_message":[],"_revision_number":1},{"id":"b562e812115627a0089a5fb7517908d8267e9028","author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"real_author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"date":"2021-06-24 02:25:53.000000000","message":"Patch Set 1: Code-Review+1\n\nMy dirty fix mentioned in the OpenOCD and libusb ticket is actually to use NULL context in libusb_helper. \n\nHowever, I like this fix since it gives the flexibility to the driver which use the helper.","accounts_in_message":[],"_revision_number":1},{"id":"7b132c72f7240ccf7c02c3c654de6bb1f60bb934","author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"real_author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"date":"2021-06-24 06:44:49.000000000","message":"Patch Set 1: Code-Review+1\n\nTested under windows 10.\nSt-link now works fine with the newest libusb.\nOld libusb library also works.","accounts_in_message":[],"_revision_number":1},{"id":"fe6eb9712f20ab1e72b57f70051262c41f22e248","author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"real_author":{"_account_id":1000410,"name":"Oleksij Rempel","email":"linux@rempel-privat.de","username":"olerem"},"date":"2021-06-24 06:47:20.000000000","message":"Patch Set 1: Code-Review+2","accounts_in_message":[],"_revision_number":1},{"id":"c9b6e04a3bc0208c8ad98b255231073e87953edc","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-06-24 07:10:36.000000000","message":"Patch Set 1: Code-Review+1\n\nThis is a bug fix, so I tried to minimize the overall code.\nAgree with Andreas, we could have used NULL context.\nThe only case I see where we should use libusb context is if openocd evolves to use multiple adapters. In such case we would probably prefer decoupling the driver\u0027s code by using multiple context.\nWe already have local context in other drivers (grep -rw libusb_init src).\nBut then this libusb_helper will not work for two drivers that use it (or for a driver called twice) because it has a single global container \"jtag_libusb_context\".\nSo further development will be required in such case.\nI would prefer sticking with this code for the time being.","accounts_in_message":[],"_revision_number":1},{"id":"abfbe0a8d317621e630ef1f91d07e6e96edd122c","author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"real_author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"date":"2021-06-24 07:48:16.000000000","message":"Patch Set 1:\n\n\u003e This is a bug fix, so I tried to minimize the overall code.\n \u003e Agree with Andreas, we could have used NULL context.\n \u003e The only case I see where we should use libusb context is if\n \u003e openocd evolves to use multiple adapters. In such case we would\n \u003e probably prefer decoupling the driver\u0027s code by using multiple\n \u003e context.\n \u003e We already have local context in other drivers (grep -rw\n \u003e libusb_init src).\n \u003e But then this libusb_helper will not work for two drivers that use\n \u003e it (or for a driver called twice) because it has a single global\n \u003e container \"jtag_libusb_context\".\n \u003e So further development will be required in such case.\n \u003e I would prefer sticking with this code for the time being.\n\nI agree.","accounts_in_message":[],"_revision_number":1},{"id":"4323987c6e13e2632844be4075243fc4e26f7482","author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"real_author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"date":"2021-06-24 09:20:56.000000000","message":"Patch Set 1:\n\n\u003e This is a bug fix, so I tried to minimize the overall code.\n\nTBH, Xiaofan\u0027s fix was a lot less code. Together with a \u0027const\u0027 on the static jtag_libusb_context to make sure it stays on it\u0027s initial value of NULL, I\u0027d even say it\u0027s the more correct fix, since it would work even for multiple calls to jtag_libusb_open() if they ever were to happen.\n\nThe longer term improvement I think would involve removing all those libusb wrappers which are just remains of when we supported libusb-0.1.","accounts_in_message":[],"_revision_number":1},{"id":"9eabb40c76b12962efe7f974b31b5fd1f893caa5","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-06-26 13:37:40.000000000","message":"Patch Set 1:\n\n\u003e \u003e This is a bug fix, so I tried to minimize the overall code.\n \u003e \n \u003e TBH, Xiaofan\u0027s fix was a lot less code. Together with a \u0027const\u0027 on\n \u003e the static jtag_libusb_context to make sure it stays on it\u0027s\n \u003e initial value of NULL, I\u0027d even say it\u0027s the more correct fix,\n \u003e since it would work even for multiple calls to jtag_libusb_open()\n \u003e if they ever were to happen.\n\nIn current OpenOCD\u0027s code we have 29 calls to libusb APIs that require the libusb_contex. 28 out of these 29 use a non-NULL context.\nFor consistency, I still prefer this current fix.\nAlso, 12 drivers (out of 30+) use the libusb helper. I don\u0027t expect Xiaofan\u0027s change on libusb_init() could compromise any of these drivers, but I didn\u0027t check.\n\n \u003e The longer term improvement I think would involve removing all\n \u003e those libusb wrappers which are just remains of when we supported\n \u003e libusb-0.1.\n\nAgree, or keeping it only to wrap libusb APIs and return OpenOCD error codes.","accounts_in_message":[],"_revision_number":1},{"id":"c542992a2e296b8f1bc0f257fa056cfcf97a5962","author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"real_author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"date":"2021-06-26 13:51:50.000000000","message":"Patch Set 1:\n\n\u003e In current OpenOCD\u0027s code we have 29 calls to libusb APIs that\n \u003e require the libusb_contex. 28 out of these 29 use a non-NULL\n \u003e context.\n \u003e For consistency, I still prefer this current fix.\n \u003e Also, 12 drivers (out of 30+) use the libusb helper. I don\u0027t expect\n \u003e Xiaofan\u0027s change on libusb_init() could compromise any of these\n \u003e drivers, but I didn\u0027t check.\n\nI agree with you.\n\n \u003e \u003e The longer term improvement I think would involve removing all\n \u003e \u003e those libusb wrappers which are just remains of when we supported\n \u003e \u003e libusb-0.1.\n \u003e \n \u003e Agree, or keeping it only to wrap libusb APIs and return OpenOCD\n \u003e error codes.\n\nI think it is better to remove the helper. mpsse codes do not use the helper, for example.","accounts_in_message":[],"_revision_number":1},{"id":"01042487c94a15b82c93a344fe4e970ccaff7d0c","author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"real_author":{"_account_id":1000019,"name":"Xiaofan Chen","email":"xiaofanc@gmail.com","username":"xiaofan"},"date":"2021-06-26 13:53:32.000000000","message":"Patch Set 1:\n\nAll in all, I think it is better to apply this patch and then talk about the improvement like removing the helper in other patches.","accounts_in_message":[],"_revision_number":1},{"id":"01d77f62b6decc64d0fbc14a6c9ab2d670cc0c86","author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"real_author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"date":"2021-06-26 21:02:19.000000000","message":"Patch Set 1: Code-Review+2","accounts_in_message":[],"_revision_number":1},{"id":"742743edc35de5607c14aa309cefb5429750f736","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-06-27 13:57:43.000000000","message":"Change has been successfully cherry-picked as cff0e417da58adef1ceef9a63a99412c2cc87ff3 by Antonio Borneo","accounts_in_message":[],"_revision_number":2}],"current_revision":"cff0e417da58adef1ceef9a63a99412c2cc87ff3","revisions":{"cff0e417da58adef1ceef9a63a99412c2cc87ff3":{"kind":"REWORK","_number":2,"created":"2021-06-27 13:57:43.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/31/6331/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/31/6331/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/2 \u0026\u0026 git checkout -b change-6331 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/31/6331/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"94ba5219ede27d6193ebac15af0468de60c9bfca","subject":"flash/nor/stm32l4: Fix stm32l4_probe()"}],"author":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-06-23 14:52:16.000000000","tz":120},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-06-27 13:57:43.000000000","tz":60},"subject":"stlink: fix SIGSEGV with libusb v1.0.24-33-g32a2206 (11618)","message":"stlink: fix SIGSEGV with libusb v1.0.24-33-g32a2206 (11618)\n\nThe stlink driver incorrectly uses a NULL pointer for libusb\u0027s\nstruct libusb_context.\nThe correct value to be used is local in libusb_helper.c.\n\nMove in the helper file, in a wrapper function, the only call that\nrequires the above value, and let stlink driver to use this\nwrapper.\n\nThis issue has not triggered any visible problem until a code\nrefactoring [1] in libusb has made OpenOCD crashing on Windows and\non MacOS.\n\nChange-Id: Id1818c8af7cf0d4d17dfa1d22aad079da01ef740\nSigned-off-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\nFixes: https://sourceforge.net/p/openocd/tickets/308/\nFixes: https://github.com/libusb/libusb/issues/928/\nFixes: 42d8fa899c6a (\"stlink_usb: Submit multiple USB URBs at once to improve performance\")\nLink: [1] https://github.com/libusb/libusb/commit/32a22069428c\nReported-by: Andrzej Sierżęga \u003casier70@gmail.com\u003e\nCo-developed-by: Andrzej Sierżęga \u003casier70@gmail.com\u003e\nCo-developed-by: Xiaofan Chen \u003cxiaofanc@gmail.com\u003e\nReviewed-on: http://openocd.zylin.com/6331\nTested-by: jenkins\nReviewed-by: Marc Schink \u003cdev@zapb.de\u003e\nReviewed-by: Xiaofan \u003cxiaofanc@gmail.com\u003e\nReviewed-by: Andrzej Sierżęga \u003casier70@gmail.com\u003e\nReviewed-by: Oleksij Rempel \u003clinux@rempel-privat.de\u003e\nReviewed-by: Andreas Fritiofson \u003candreas.fritiofson@gmail.com\u003e\n"}},"5ed3a24b2b93c47fed8392d1603345f6f4b2697c":{"kind":"REWORK","_number":1,"created":"2021-06-23 15:36:56.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/31/6331/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/31/6331/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/1 \u0026\u0026 git checkout -b change-6331 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/31/6331/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/31/6331/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"42a0bf3c360c1eae418223f0ab535b4d7accae83","subject":"Doc fix: echo writes to the log, and not to stdout"}],"author":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-06-23 14:52:16.000000000","tz":120},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-06-23 15:36:05.000000000","tz":120},"subject":"stlink: fix SIGSEGV with libusb v1.0.24-33-g32a2206 (11618)","message":"stlink: fix SIGSEGV with libusb v1.0.24-33-g32a2206 (11618)\n\nThe stlink driver incorrectly uses a NULL pointer for libusb\u0027s\nstruct libusb_context.\nThe correct value to be used is local in libusb_helper.c.\n\nMove in the helper file, in a wrapper function, the only call that\nrequires the above value, and let stlink driver to use this\nwrapper.\n\nThis issue has not triggered any visible problem until a code\nrefactoring [1] in libusb has made OpenOCD crashing on Windows and\non MacOS.\n\nChange-Id: Id1818c8af7cf0d4d17dfa1d22aad079da01ef740\nSigned-off-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\nFixes: https://sourceforge.net/p/openocd/tickets/308/\nFixes: https://github.com/libusb/libusb/issues/928/\nFixes: 42d8fa899c6a (\"stlink_usb: Submit multiple USB URBs at once to improve performance\")\nLink: [1] https://github.com/libusb/libusb/commit/32a22069428c\nReported-by: Andrzej Sierżęga \u003casier70@gmail.com\u003e\nCo-developed-by: Andrzej Sierżęga \u003casier70@gmail.com\u003e\nCo-developed-by: Xiaofan Chen \u003cxiaofanc@gmail.com\u003e\n"}}},"requirements":[],"submit_records":[],"submit_requirements":[]}
