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 6BB6823C8C7; Mon, 13 Apr 2026 17:00:35 +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=1776099635; cv=none; b=EMpenASZWNijjVBCOO37+FprWfWlfWP5XPZam7zueeB8XDlxFg7OIvEmkNzPB4XPSLR74x7fVRRjs6YkjXpcGEYCXuMa6PHPfKoaPpBmUjDUyeymi2JcxUC/SL+zwHi4w0qJBAj8w06TI3djPkNxlN0jWEUUyY6her4TlrE+8P8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776099635; c=relaxed/simple; bh=dc+x41aXunnCpixEOw9pcpct4SjwhG8KrGoLcujoPkU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZCXgk2UjpLGKbbNA5hw1EkkN5/T84zzZ0zjldUK4ZdFSLXjO4lwMJWPoBb5hRmy8raZny20kBKKWM3k1UeLFI3NFc+t9rL88VwHLljScbBLbX04JXstEosaxRpHqV8kUSjP5xYI7S8d3jI8uyzebbDQuEUPMv0Wuw6/SZdNE9eQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eQklDR6m; 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="eQklDR6m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBA64C2BCAF; Mon, 13 Apr 2026 17:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776099635; bh=dc+x41aXunnCpixEOw9pcpct4SjwhG8KrGoLcujoPkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQklDR6mxWMRUaRODf9xaZ2b8253nBgEDEUc0ttxZscPY0gM3ARYFhaWM67DFQQbR XlK1ev5ZNgqWeE3gJsOKp1dGyxAzJIi44emUp8KWEsf73xYZND/fZu6mfs+9efZk/+ G27QzhQrsFT+Krdk+sBCQ8YF01XVkM/OXfz2Ty7g= 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 5.10 414/491] wifi: rt2x00usb: fix devres lifetime Date: Mon, 13 Apr 2026 18:00:59 +0200 Message-ID: <20260413155834.526875387@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155819.042779211@linuxfoundation.org> References: <20260413155819.042779211@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 5.10-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 @@ -830,7 +830,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) {