From ac1b03c8e59408336d07527e2597171cb99ed654 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 10 Sep 2018 19:09:20 +0200 Subject: mgcp_osmux.c: osmux_enable_endpoint: Fix incorrect return check osmux_xfrm_input_open_circuit returns 0 on success and -1 on error. Confusion comes from that function being implemented by calling osmux_batch_add_circuit which returns NULL on error. Change-Id: I98700aa1e2fab9784706bfac1a47cc84635172b7 --- openbsc/src/libmgcp/mgcp_osmux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsc') diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index 69124d2a9..8a802f53c 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -456,8 +456,8 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint LOGP(DMGCP, LOGL_ERROR, "Cannot allocate input osmux handle\n"); return -1; } - if (!osmux_xfrm_input_open_circuit(endp->osmux.in, endp->osmux.cid, - endp->cfg->osmux_dummy)) { + if (osmux_xfrm_input_open_circuit(endp->osmux.in, endp->osmux.cid, + endp->cfg->osmux_dummy) < 0) { LOGP(DMGCP, LOGL_ERROR, "Cannot open osmux circuit %u\n", endp->osmux.cid); return -1; -- cgit v1.2.3