aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-10-13 17:47:23 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-10-13 17:47:25 +0200
commit0e2a20bfb4e842d91bd14291d4304ab024b3c6cf (patch)
tree7a7fddd8a6aaf8008f02f0ecf0e0e811c76c9c13
parent7643be1d5556a933c54c79e8deeccada3b01f441 (diff)
bts-trx: Guard call to trx_sched_clean with NULL trx ptr
trx_phy_inst_open() already guards against NULL trx ptr when calling trx_sched_init(). Later on, in same path, trx_phy_inst_close() can be called which ends up calling trx_sched_clean(trx), this time not being guarded against NULL trx. This fixes Coverity CID#240498. Fixes: CID#240498 Change-Id: I00afc739559d57dd98db68c76f2a85006c15e875
-rw-r--r--src/osmo-bts-trx/trx_if.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index f0c87469..914d0e13 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -1272,7 +1272,8 @@ static void trx_phy_inst_close(struct phy_instance *pinst)
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
trx_if_close(l1h);
- trx_sched_clean(pinst->trx);
+ if (pinst->trx)
+ trx_sched_clean(pinst->trx);
}
/*! open the control + burst data sockets for one phy_instance */