diff mbox

ppp: fix pptp double release_sock in pptp_bind()

Message ID 20111207014712.GB25869@dztty
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Djalal Harouni Dec. 7, 2011, 1:47 a.m. UTC
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
---
 drivers/net/ppp/pptp.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Comments

Eric Dumazet Dec. 7, 2011, 4:59 a.m. UTC | #1
Le mercredi 07 décembre 2011 à 02:47 +0100, Djalal Harouni a écrit :
> Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
> ---
>  drivers/net/ppp/pptp.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
> index 89f829f..f8a6853 100644
> --- a/drivers/net/ppp/pptp.c
> +++ b/drivers/net/ppp/pptp.c
> @@ -423,10 +423,8 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
>  	lock_sock(sk);
>  
>  	opt->src_addr = sp->sa_addr.pptp;
> -	if (add_chan(po)) {
> -		release_sock(sk);
> +	if (add_chan(po))
>  		error = -EBUSY;
> -	}
>  
>  	release_sock(sk);
>  	return error;

Nice catch !

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 7, 2011, 6:38 p.m. UTC | #2
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 07 Dec 2011 05:59:54 +0100

> Le mercredi 07 décembre 2011 à 02:47 +0100, Djalal Harouni a écrit :
>> Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
 ...
> Nice catch !
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 89f829f..f8a6853 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -423,10 +423,8 @@  static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
 	lock_sock(sk);
 
 	opt->src_addr = sp->sa_addr.pptp;
-	if (add_chan(po)) {
-		release_sock(sk);
+	if (add_chan(po))
 		error = -EBUSY;
-	}
 
 	release_sock(sk);
 	return error;