summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-06-08 15:46:44 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commita1e379842c09d3b9effe80ad84e4d1d5ddcae92b (patch)
tree48eb2284c112c64b00d754a765b2195d5eca2f92
parent1d53baccfafb96a0430c275efd2a9400f87e298a (diff)
host/trxcon: fix NULL-pointer deference
-rw-r--r--src/host/trxcon/l1ctl_link.c4
-rw-r--r--src/host/trxcon/trx_if.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index e52950f..62e8943 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -247,6 +247,10 @@ void l1ctl_link_shutdown(struct l1ctl_link *l1l)
{
struct osmo_fd *listen_bfd;
+ /* May be unallocated due to init error */
+ if (!l1l)
+ return;
+
LOGP(DL1C, LOGL_NOTICE, "Shutdown L1CTL link\n");
listen_bfd = &l1l->listen_bfd;
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 0607167..9ae4900 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -592,6 +592,10 @@ static void trx_if_flush_ctrl(struct trx_instance *trx)
void trx_if_close(struct trx_instance *trx)
{
+ /* May be unallocated due to init error */
+ if (!trx)
+ return;
+
LOGP(DTRX, LOGL_NOTICE, "Shutdown transceiver interface\n");
/* Flush CTRL message list */