Subject: Re: [PATCH net 2/2] mptcp: more accurate NL event generation

From: Greg KH <[email-masked]>
Date: Tue, 25 Jul 2023 20:39:19 +0200

On Tue, Jul 25, 2023 at 11:34:56AM -0700, Mat Martineau wrote:
> From: Paolo Abeni <[email-masked]>
> 
> Currently the mptcp code generate a "new listener" event even
> if the actual listen() syscall fails. Address the issue moving
> the event generation call under the successful branch.
> 
> Fixes: f8c9dfbd875b ("mptcp: add pm listener events")
> Reviewed-by: Mat Martineau <[email-masked]>
> Signed-off-by: Paolo Abeni <[email-masked]>
> Signed-off-by: Mat Martineau <[email-masked]>
> ---
>  net/mptcp/protocol.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 3613489eb6e3..3317d1cca156 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -3723,10 +3723,9 @@ static int mptcp_listen(struct socket *sock, int backlog)
>  	if (!err) {
>  		sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
>  		mptcp_copy_inaddrs(sk, ssock->sk);
> +		mptcp_event_pm_listener(ssock->sk, MPTCP_EVENT_LISTENER_CREATED);
>  	}
>  
> -	mptcp_event_pm_listener(ssock->sk, MPTCP_EVENT_LISTENER_CREATED);
> -
>  unlock:
>  	release_sock(sk);
>  	return err;
> 
> -- 
> 2.41.0
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>