From 1adcc27eb9835f290e4f152ef5931e6d4c766c91 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 7 Apr 2021 03:56:03 +0200 Subject: [PATCH] l1sap: use TLVP_PRES_LEN() macro in l1sap_chan_act() Change-Id: I6793623622fd7303d7dc22117a163a6990497c28 Related: SYS#4895, OS#4941 --- src/common/l1sap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index aee47179d..3ebe8e19b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1969,8 +1969,7 @@ int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed * /* osmo-pcu calls this without a valid 'tp' parameter, so we * need to make sure ew don't crash here */ - if (tp && TLVP_PRESENT(tp, GSM48_IE_CHANDESC_2) && - TLVP_LEN(tp, GSM48_IE_CHANDESC_2) >= sizeof(*cd)) { + if (tp && TLVP_PRES_LEN(tp, GSM48_IE_CHANDESC_2, sizeof(*cd))) { cd = (struct gsm48_chan_desc *) TLVP_VAL(tp, GSM48_IE_CHANDESC_2);