diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-04-03 12:10:24 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-04-03 12:42:04 +0200 |
commit | 4ace424fa7842bcf9b5ffc0d1412c0e339ee4468 (patch) | |
tree | f12df0ed4e0112e69c76718b3e9ce09027106db4 /openbsc | |
parent | c8b2c2f10ea8ad9f4bc8db656a7190dd5ea39f74 (diff) |
ipa: Be consistent in checking conn->cfg (Coverity)
Coverity complains about checking connection->cfg in
bsc_close_connection() at one place but not at the second.
This patch fixes this by adding a check before accessing cfg when
generating the 'partial message' log message.
Fixes: Coverity CID 1195180
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 954cf1fc6..0d0fd586b 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -916,7 +916,7 @@ void bsc_close_connection(struct bsc_connection *connection) if (connection->pending_msg) { LOGP(DNAT, LOGL_ERROR, "Dropping partial message on connection %d.\n", - connection->cfg->nr); + connection->cfg ? connection->cfg->nr : -1); msgb_free(connection->pending_msg); connection->pending_msg = NULL; } |