laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/30152 ) Change subject: remsim-client-st2: Proper error if not all endpoints can be found ...................................................................... remsim-client-st2: Proper error if not all endpoints can be found Let's avoid a segfault and rather print a proper error message in case we cannot find all the required USB endpoints when opening the user-specified interface/config/device. This can happen if the device is currently in DFU mode, or a completely wrong device/interface was specified. Before this patch: Assert failed rc == 0 user_simtrace2.c:305 After this patch: DMAIN ERROR user_simtrace2.c:448 specified USB dev/config/interface doesn't have at least one IN, OUT and IRQ_IN endpoint Closes: OS#5416 Change-Id: Icfcc482fff106a232c5125ed8ab463ecc13824ae --- M src/client/user_simtrace2.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/52/30152/1 diff --git a/src/client/user_simtrace2.c b/src/client/user_simtrace2.c index f71c720..29ab196 100644 --- a/src/client/user_simtrace2.c +++ b/src/client/user_simtrace2.c @@ -444,6 +444,12 @@ goto close_exit; } + if (!transp->usb_ep.in || !transp->usb_ep.out || !transp->usb_ep.irq_in) { + LOGP(DMAIN, LOGL_ERROR, "specified USB dev/config/interface doesn't have " + "at least one IN, OUT and IRQ_IN endpoint\n"); + goto close_exit; + } + allocate_and_submit_irq(ci); /* submit multiple IN URB in order to work around OS#4409 */ for (i = 0; i < 4; i++) -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/30152 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: Icfcc482fff106a232c5125ed8ab463ecc13824ae Gerrit-Change-Number: 30152 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-MessageType: newchange