From 1ebc0422d66c23be9294d2dc243dcba62f31ecd4 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 8 Oct 2020 21:16:22 +0200 Subject: gsm_08_08: fix unreachable code in parse_powercap() The function parse_powercap() contains a nested switch case statement that is used to populate the variables lu and pwr_lev. Those variables are used at the bottom of the function later. Unfortunately the (outer) switch case that consumes the pdisc variable does not put a break; at the end of its only case "GSM48_PDISC_MM", which eventually causes a fall through to the default case, which simply returns. Since this can not be intended, lets add a break to make the bottom code reachable in case lu and pwr_lev are successfully populated. Change-Id: I48331cca784d8fa3a5904f2c4cf1555622b319e8 Fixes: CID#214886 --- src/osmo-bsc/gsm_08_08.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/osmo-bsc') diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c index f3214c7db..b7c744865 100644 --- a/src/osmo-bsc/gsm_08_08.c +++ b/src/osmo-bsc/gsm_08_08.c @@ -343,6 +343,7 @@ static void parse_powercap(struct gsm_subscriber_connection *conn, struct msgb * /* No power cap in other messages */ return; } + break; /* FIXME: pwr_lev in Paging Response? */ default: /* No power cap in other messages */ -- cgit v1.2.3