From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79EB2745F8 for ; Tue, 20 Feb 2024 15:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708441777; cv=none; b=W6WFL8PfsMOqMQm4tWyWSTp4hXMvHgSDwlxOps4O+J/wEdgb4pnpPUKT4an9HacyTFzM0VkGSvt3eMTqK0ulhx1NB6A5C8LBUxiErfOgg3ojfc6dselm/xeGFcxsfR0FeNYD/5fMaC7IlmSev2erIxWkhqspgUfk/lEAwg6wc7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708441777; c=relaxed/simple; bh=I8b8ggHlPnPeNRhnW2YzffNa4rX5cdXDVl/VGsL3GIc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hVRsDr8LsgePgYn8bagOpp+szB1akQsWLnlw/F971XhbFKiCkOYzIQuRyUztYx+kRWVaxO0k1nhu4yJYYFQXVGQwKZPnsxn6IHmxfYXfdxhA0TxLxY+VnUOHS9ejlF+3YItADO1nkYJHmUDJHtheR0MvkS1btfVnrez5rbWGhSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SlYab9eJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SlYab9eJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7303C433C7; Tue, 20 Feb 2024 15:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708441777; bh=I8b8ggHlPnPeNRhnW2YzffNa4rX5cdXDVl/VGsL3GIc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SlYab9eJZ2VDM6UfuJQI+rmdvuM/e2Hm3ixYtTkbecI/QJ/1lP9h7Ewpoy2DppxZn ap7eWib9WjI9Q+o3TCPllV2fbAVdNfxIDtDBZ9sVSmQxYZ3PvPljzYbYRJSmzyFylZ TBEncURXo5TQ0GI9iM4OQD8veqYMC/XvXD553jdaonQCmRChg1SVS6Y7fk8C9t0vyS CTBKJLpztmbHRNj/l8epHEJyNOmUsxt8hXQ45ARvA3H0WXOVoblRKsmNIWxLpbYK8s zwjK14V9dFDw8yUURGEKD228BlZymT3uDLEbE19pCKpqKRZWewHEDysKjAiJHEok8D pmjNWbuOf+NVQ== Date: Tue, 20 Feb 2024 15:09:33 +0000 From: Simon Horman To: Jeremy Kerr Cc: netdev@vger.kernel.org, Matt Johnston , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [PATCH net-next v2] net: mctp: take ownership of skb in mctp_local_output Message-ID: <20240220150933.GP40273@kernel.org> References: <20240220081053.1439104-1-jk@codeconstruct.com.au> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240220081053.1439104-1-jk@codeconstruct.com.au> 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 > > --- > v2: > - retain EINVAL return code in !rt && !ifindex case. Based on feedback > from Simon Horman . Hi Jeremy, Thanks for the update. This one looks good to me. Reviewed-by: Simon Horman