From 13692a6bd3df90d80cdbc4fd6852c69c6a99ea9b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 22 May 2011 20:06:11 +0200 Subject: gsmtap: deal with apps that call gsmtap_send*() with NULL gsmtap_inst --- src/gsmtap_util.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gsmtap_util.c') diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 5c68b6a0..3d20bfc2 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -148,6 +148,9 @@ int gsmtap_source_add_sink_fd(int gsmtap_fd) int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg) { + if (!gti) + return -ENODEV; + if (gti->ofd_wq_mode) return osmo_wqueue_enqueue(>i->wq, msg); else { @@ -175,6 +178,9 @@ int gsmtap_send(struct gsmtap_inst *gti, uint16_t arfcn, uint8_t ts, { struct msgb *msg; + if (!gti) + return -ENODEV; + msg = gsmtap_makemsg(arfcn, ts, chan_type, ss, fn, signal_dbm, snr, data, len); if (!msg) -- cgit v1.2.3