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 50C5526F293; Mon, 13 Apr 2026 16:07:14 +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=1776096434; cv=none; b=aO370ro6+ZUXfIPXD5anKt2nx5suTqdQ5BC7zFTJ9ExXWBdyWH7M30JJvZwNAK3/vD41nFuCAuHhV67641Ceziz+x324wMnNsxsk65Llqwio0rnp0Jg1Pz0Tj8wP8yrsaV6nnuHlJfAo9XKEerYaBX40ztofIYVZTB+ByoNnl68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096434; c=relaxed/simple; bh=MmZCIhG5NCdezPmY7jkM/JMxV1bhBz+LRlJhK2zWwEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=flU60st9aC/dEF0MqEqqmF5Ad5AM2e+YZhbf8HzZBIOJiYLOTDkHOGTMX36rpo+k+FwufR37ERVaWt09jFTYQASMuyx5K8pSrOpFs1rsTihsmb1O5pfLSo63tO3agG6Z/EuK8n31FxeFgRi5/wRhAegrz6JYLh1OSaEiNuLzdR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L9v/kmR7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="L9v/kmR7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9E7BC2BCAF; Mon, 13 Apr 2026 16:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096434; bh=MmZCIhG5NCdezPmY7jkM/JMxV1bhBz+LRlJhK2zWwEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9v/kmR7P/iJRz+3eARPeHOrsar04jqy2c1Bfv3/F1yAwqp9a0x02Um5Ovhj1P19Q TEj7aF2N5b9T0SfkTUFrrXah68+dJcqHCX4SHgacyK5xLgbuji5MCR9kJ2fJNpaNZa NWs1jhUSJzVMrb7jLXFXVetFD3diXW+M7O+jBcEI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vishal Thanki , Johan Hovold , Stanislaw Gruszka , Johannes Berg Subject: [PATCH 6.18 02/83] wifi: rt2x00usb: fix devres lifetime Date: Mon, 13 Apr 2026 17:59:30 +0200 Message-ID: <20260413155731.116478285@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155731.019638460@linuxfoundation.org> References: <20260413155731.019638460@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 25369b22223d1c56e42a0cd4ac9137349d5a898e upstream. USB drivers bind to USB interfaces and any device managed resources should have their lifetime tied to the interface rather than parent USB device. This avoids issues like memory leaks when drivers are unbound without their devices being physically disconnected (e.g. on probe deferral or configuration changes). Fix the USB anchor lifetime so that it is released on driver unbind. Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") Cc: stable@vger.kernel.org # 4.7 Cc: Vishal Thanki Signed-off-by: Johan Hovold Acked-by: Stanislaw Gruszka Reviewed-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20260327113219.1313748-1-johan@kernel.org Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -828,7 +828,7 @@ int rt2x00usb_probe(struct usb_interface if (retval) goto exit_free_device; - rt2x00dev->anchor = devm_kmalloc(&usb_dev->dev, + rt2x00dev->anchor = devm_kmalloc(&usb_intf->dev, sizeof(struct usb_anchor), GFP_KERNEL); if (!rt2x00dev->anchor) {