Subject: Re: [PATCH net-next v2] net: mctp: take ownership of skb in mctp_local_output

From: Simon Horman <[email-masked]>
Date: Tue, 20 Feb 2024 15:09:33 +0000

On Tue, Feb 20, 2024 at 04:10:53PM +0800, Jeremy Kerr wrote:
> Currently, mctp_local_output only takes ownership of skb on success, and
> we may leak an skb if mctp_local_output fails in specific states; the
> skb ownership isn't transferred until the actual output routing occurs.
> 
> Instead, make mctp_local_output free the skb on all error paths up to
> the route action, so it always consumes the passed skb.
> 
> Fixes: 833ef3b91de6 ("mctp: Populate socket implementation")
> Signed-off-by: Jeremy Kerr <[email-masked]>
> 
> ---
> v2:
>  - retain EINVAL return code in !rt && !ifindex case. Based on feedback
>    from Simon Horman <[email-masked]>.

Hi Jeremy,

Thanks for the update.
This one looks good to me.

Reviewed-by: Simon Horman <[email-masked]>