changeset 23:0d70444b5070

ater: more robust msgb handling in TRAU-UL output
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 24 Jun 2024 18:21:01 +0000
parents bacc590ec839
children f49e57b0d1a2
files ater/tx_func.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ater/tx_func.c	Mon Jun 24 09:28:28 2024 +0000
+++ b/ater/tx_func.c	Mon Jun 24 18:21:01 2024 +0000
@@ -48,6 +48,10 @@
 	if (!msg)
 		return;
 	len = osmo_trau_frame_encode(msg->tail, msgb_tailroom(msg), fr);
+	if (len <= 0) {
+		msgb_free(msg);
+		return;
+	}
 	msgb_put(msg, len);
 	osmo_i460_mux_enqueue(at->schan, msg);
 }