diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-05-22 20:06:11 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-05-22 20:06:11 +0200 |
commit | 13692a6bd3df90d80cdbc4fd6852c69c6a99ea9b (patch) | |
tree | 7608e30028c48487e54b5721e1a5124a26970bd0 /src | |
parent | b62b04bbf320dca6d81a95e9b0dea0251ad4a665 (diff) |
gsmtap: deal with apps that call gsmtap_send*() with NULL gsmtap_inst
Diffstat (limited to 'src')
-rw-r--r-- | src/gsmtap_util.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) |