osmo-bts[master]: Check return value to prevent crash

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Sep 8 10:58:35 UTC 2017


Patch Set 4:

(2 comments)

https://gerrit.osmocom.org/#/c/3878/4/src/osmo-bts-litecell15/l1_transp_hw.c
File src/osmo-bts-litecell15/l1_transp_hw.c:

Line 208: 	count = (rc <= 0) ? 0 : (rc / prim_size);
I'd use "<" instead of "<=" to differentiate "normal" behavior from error, but it's good this way too.

I'd add a message with NOTICE or similar level to show there was an issue with readv, and printing rc. I guess l1if_fd_cb is called because we are polling some socket and we received an event on that socket, so I would not expect to receive an ERROR here and we should know what's going on next time this issue appears, as it may be showing up something's wrong somewhere else too.


https://gerrit.osmocom.org/#/c/3878/4/src/osmo-bts-sysmo/l1_transp_hw.c
File src/osmo-bts-sysmo/l1_transp_hw.c:

Line 219: 	count = (rc <= 0) ? 0 : (rc / prim_size);
Same here.


-- 
To view, visit https://gerrit.osmocom.org/3878
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list