Change in osmo-e1d[master]: usb: Don't pass negative length values to e1_line_demux_in()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Sep 1 07:41:00 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/19928 )

Change subject: usb: Don't pass negative length values to e1_line_demux_in()
......................................................................

usb: Don't pass negative length values to e1_line_demux_in()

every so often, the USB transfer completes without data (due to
"unlucky" time alignment between E1 and USB frame clock).  Don't
call the demuxer in that case.

Otherwise the user is confused by error messages like

<0001> intf_line.c:467 (I0:L0) IN ERROR: -4

Change-Id: Ia99f97c2cca44d15a83a54cebe884b343ec44f46
---
M src/usb.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  tnt: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/usb.c b/src/usb.c
index 7a5dce2..7f7f5c6 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -107,6 +107,8 @@
 static int
 e1_usb_xfer_in(struct e1_usb_flow *flow, uint8_t *buf, int size)
 {
+	if (size == 0)
+		return 0;
 	return e1_line_demux_in(flow->line, buf + 4, size - 4);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/19928
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ia99f97c2cca44d15a83a54cebe884b343ec44f46
Gerrit-Change-Number: 19928
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200901/6f5d7eb2/attachment.htm>


More information about the gerrit-log mailing list