diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-06-08 15:46:44 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-11-19 17:35:07 +0700 |
commit | 65664d088d3d2b30d108ca0b1b8b2f0244d0d7e4 (patch) | |
tree | ded8b95d6cdd106508d5d0336b7512a644033fcd | |
parent | 48f2cb4b3b94000647358ddd7d06edbb55495bba (diff) |
host/trxcon: fix NULL-pointer deference
Change-Id: Idc036d4ea32b4aa3f4841d39144ef1733414728e
-rw-r--r-- | src/host/trxcon/l1ctl_link.c | 4 | ||||
-rw-r--r-- | src/host/trxcon/trx_if.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c index e52950fa..62e8943f 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 06071679..9ae49006 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 */ |