laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-uecups/+/33791 )
Change subject: gtp_tunnel: Avoid double-unlock in error path of gtp_tunnel_alloc ......................................................................
gtp_tunnel: Avoid double-unlock in error path of gtp_tunnel_alloc
Fixes: CID#307509: Double unlock (LOCK) Change-Id: Ie6e4c08d2c235fbe90516c3dfe2c82963fd70a6f --- M daemon/gtp_tunnel.c 1 file changed, 13 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-uecups refs/changes/91/33791/1
diff --git a/daemon/gtp_tunnel.c b/daemon/gtp_tunnel.c index f9075f7..87d1e69 100644 --- a/daemon/gtp_tunnel.c +++ b/daemon/gtp_tunnel.c @@ -28,7 +28,7 @@
t = talloc_zero(d, struct gtp_tunnel); if (!t) - goto out_unlock; + goto out; t->d = d; t->name = talloc_asprintf(t, "%s-R%08x-T%08x", cpars->tun_name, cpars->rx_teid, cpars->tx_teid); t->tun_dev = tun_device_find_or_create(d, cpars->tun_name, cpars->tun_netns_name); @@ -72,14 +72,13 @@ return t;
out_ep: + pthread_rwlock_unlock(&d->rwlock); _gtp_endpoint_release(t->gtp_ep); out_tun: _tun_device_release(t->tun_dev); out_free: talloc_free(t); -out_unlock: - pthread_rwlock_unlock(&d->rwlock); - +out: return NULL; }