diff options
author | Marco Varlese <marco.varlese@suse.com> | 2018-02-15 13:45:39 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-02-15 16:05:14 +0000 |
commit | 2802bd754413f292697ed1b164b84f7c4da8f8a5 (patch) | |
tree | 064cc55c95d6613ddcd6ac2cd9943b4184af2b1a /src/vnet/sctp/sctp.c | |
parent | 8b30e471df4d42214619e1d6c50cc8298426b45f (diff) |
SCTP: coverity warning fix
Change-Id: I1f8a325eac2a9e2c825996f04026ae86259a7ddd
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vnet/sctp/sctp.c')
-rw-r--r-- | src/vnet/sctp/sctp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c index 8fc5d9b55b2..529e4089644 100644 --- a/src/vnet/sctp/sctp.c +++ b/src/vnet/sctp/sctp.c @@ -576,7 +576,11 @@ sctp_session_get_transport (u32 conn_index, u32 thread_index) { sctp_connection_t *sctp_conn = sctp_connection_get (conn_index, thread_index); - return &sctp_conn->sub_conn[MAIN_SCTP_SUB_CONN_IDX].connection; + + if (PREDICT_TRUE (sctp_conn != NULL)) + return &sctp_conn->sub_conn[MAIN_SCTP_SUB_CONN_IDX].connection; + + return NULL; } transport_connection_t * |