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 EA9E33B9D84; Fri, 15 May 2026 16:03:21 +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=1778861002; cv=none; b=qmTVEPmICo1a4DITChvE1vMk6KKitqwKlHDs8fkZl4mBat2i07dseEb/Irw2JfRfoLnjqVr/tDsgMTX2yWX/bndBJPgAabiA+OWVSMND8m5WH2N6GjjZfA2YO9BrQzSzmRbbTEl+nzK2h8hOvK7bRfXxrGrPJSUxB4VrVx9cQQw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861002; c=relaxed/simple; bh=CcFKUmIVB/vexJdcSChb2zH9GNynxdKWbifelGciNCI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jh9s80jzEJwm/FANjpi1cgv5FAXAl1wXo5rKPOxzVS35qweoLeOZeqtBv892uqzUMhX1qH9CTWn8K5Ri66bp2LowA/IsUb5n36MsF/nYFVe2ijODBdB+kXsv23pKfHGJRAE7+RsPi6dyqeH4rB2oXC4mCrq+eOc3AExOLgVDru4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=km4fUjUA; 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="km4fUjUA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7830CC2BCC7; Fri, 15 May 2026 16:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778861001; bh=CcFKUmIVB/vexJdcSChb2zH9GNynxdKWbifelGciNCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=km4fUjUA1360KJaD07DHrqDO43F7aSOfXC7i3q+itbpXSnoTxvgLuX859CygBp92D KCod3Ft7I9LXZc81oQOcqGkeB5MsgoV77INc9a1Sx1LSl9X4P+w1RNrrEOc6PmlNJB QpQtxuOIEQpsUgjZZTHKes3PC3+WVn8TKCa+14y4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jakob Unterwurzacher , Johan Hovold , Marc Kleine-Budde Subject: [PATCH 6.6 119/474] can: ucan: fix devres lifetime Date: Fri, 15 May 2026 17:43:48 +0200 Message-ID: <20260515154717.613065148@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit fed4626501c871890da287bec62a96e52da1af89 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 control message buffer lifetime so that it is released on driver unbind. Fixes: 9f2d3eae88d2 ("can: ucan: add driver for Theobroma Systems UCAN devices") Cc: stable@vger.kernel.org # 4.19 Cc: Jakob Unterwurzacher Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260327104520.1310158-1-johan@kernel.org Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/ucan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/can/usb/ucan.c +++ b/drivers/net/can/usb/ucan.c @@ -1399,7 +1399,7 @@ static int ucan_probe(struct usb_interfa */ /* Prepare Memory for control transfers */ - ctl_msg_buffer = devm_kzalloc(&udev->dev, + ctl_msg_buffer = devm_kzalloc(&intf->dev, sizeof(union ucan_ctl_payload), GFP_KERNEL); if (!ctl_msg_buffer) {