From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from codeconstruct.com.au (pi.codeconstruct.com.au [203.29.241.158]) (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 937F02D2382; Fri, 6 Mar 2026 01:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.29.241.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772760218; cv=none; b=p4/XVXb1UdOpowmjWwJPx+UMmscoCPzPy9H4caUlBoASDiW1w5F9n9j+xrsjfAMMJsIsxNT11Pgmi5jz7g97T87daLMIJw6S9LRYxITKNpcwEOyogXrTnqqn17YVxsPp0BE7DzGyBDPAeVcydHmf5JDh4PMlOShJVM9uuWOFJ88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772760218; c=relaxed/simple; bh=+fSwAeJfOqryePzovwrmZyRsfwlXOidTguMWiwStvKU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=iPUqxx4cUJHDAv9bJBEU1O/I4y0vb3X5vOFcrBJmuYKD03S9DbYcRtHAfrfje++ouTDvSgzprq9rfNqd3oEyjT1XHAwS96ufZ/26w1gJB/A7kRHiAZPZKS1CCydRkau2iKaL695P4o9XtrsqTJOiA1kquGRIBbDh+IhDUNbKe1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codeconstruct.com.au; spf=pass smtp.mailfrom=codeconstruct.com.au; dkim=pass (2048-bit key) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.b=ETwNKXBN; arc=none smtp.client-ip=203.29.241.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codeconstruct.com.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codeconstruct.com.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.b="ETwNKXBN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeconstruct.com.au; s=2022a; t=1772760214; bh=+fSwAeJfOqryePzovwrmZyRsfwlXOidTguMWiwStvKU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ETwNKXBNhlmJbKU37O3g2oWZFNizciG17L3YoAVy/tMzJJpQ/8ZJVwYf52EZqnh7H DHduc5VFWbCXdlKe9dV3nrc2m8+Js4FEI1aJNtNZq4Q+JgOMtb6z9lUjPvQn0labW1 pT/7Daa7h5n6ts+v/oMJw7oiZsBBroAxlrFZbcsGavjQcYy60PuPldI9OEsYfrolLV JHQ8ggZqHuj9ejS4nWHloZQ5+sOMe1d65maS6vp9UipXTpeccO1D+ZaKcsQn3t5iaL Wk5xS3MCOeG2FE4yeMm/xsont6D1Jx7oYI7nISlyNx7hFvYF+4txtQFyJPQ7VCpVsa VFickH4S4V40Q== Received: from pecola.lan (unknown [159.196.93.152]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id 307FC6000D; Fri, 6 Mar 2026 09:23:33 +0800 (AWST) Message-ID: <942e3fdf0522be797a337669b9a736b56c33e5d2.camel@codeconstruct.com.au> Subject: Re: [PATCH] net: mctp: fix device leak on probe failure From: Jeremy Kerr To: Johan Hovold , Matt Johnston , Greg Kroah-Hartman Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Fri, 06 Mar 2026 09:23:33 +0800 In-Reply-To: <17790d338e59896ff843bbd3a3bf434f20b189c3.camel@codeconstruct.com.au> References: <20260305104549.16110-1-johan@kernel.org> <17790d338e59896ff843bbd3a3bf434f20b189c3.camel@codeconstruct.com.au> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2+deb12u1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 +CC Greg Context is Johan's patch at https://lore.kernel.org/netdev/20260305104549.16110-1-johan@kernel.org/ Cheers, Jeremy > Hi John, >=20 > > Driver core holds a reference to the USB interface and its parent USB > > device while the interface is bound to a driver and there is no need to > > take additional references unless the structures are needed after > > disconnect. > >=20 > > This driver takes a reference to the USB device during probe but does > > not to release it on probe failures. > >=20 > > Drop the redundant device reference to fix the leak, reduce cargo > > culting, make it easier to spot drivers where an extra reference is > > needed, and reduce the risk of further memory leaks. >=20 > Sounds good, but I would suggest syncing with Greg K-H too; he's in the > process of doing a v2 for the same thing: >=20 > =C2=A0 https://lore.kernel.org/netdev/2026022539-punch-supper-884c@gregkh= / >=20 > Given the discussion there, this looks in-line with the longer-term move > from usb_get_dev(), so: >=20 > Acked-by: Jeremy Kerr >=20 > Thanks, >=20 >=20 > Jeremy