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

Message ID 1447686417-3979-8-git-send-email-aschultz@tpip.net
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Andreas Schultz Nov. 16, 2015, 3:06 p.m. UTC
The ordering of the error case exit was wrong and would
attempt to release the wrong socket.

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

Comments

Pablo Neira Ayuso Nov. 16, 2015, 5:48 p.m. UTC | #1
On Mon, Nov 16, 2015 at 04:06:48PM +0100, Andreas Schultz wrote:
> The ordering of the error case exit was wrong and would
> attempt to release the wrong socket.

also applied.

Patch
diff mbox

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;
 }