[PATCH 07/16] gtp: fix the order of error cases in gtp_encap_enable

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Andreas Schultz aschultz at tpip.net
Mon Nov 16 15:06:48 UTC 2015


The ordering of the error case exit was wrong and would
attempt to release the wrong socket.

Signed-off-by: Andreas Schultz <aschultz at tpip.net>
---
 gtp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gtp.c b/gtp.c
index 4f5729e..61add82 100644
--- a/gtp.c
+++ b/gtp.c
@@ -967,10 +967,10 @@ static int gtp_encap_enable(struct net_device *dev, struct gtp_instance *gti,
 	sk->sk_user_data = gti;
 
 	return 0;
-err1:
-	sockfd_put(sock0);
 err2:
 	sockfd_put(sock1u);
+err1:
+	sockfd_put(sock0);
 	return err;
 }
 
-- 
2.5.0




More information about the OpenBSC mailing list