FAILED: patch "[PATCH] can: ucan: fix devres lifetime" failed to apply to 5.15-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x fed4626501c871890da287bec62a96e52da1af89
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026050411-monsoon-twitch-7df9@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fed4626501c871890da287bec62a96e52da1af89 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Fri, 27 Mar 2026 11:45:20 +0100
Subject: [PATCH] can: ucan: fix devres lifetime
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.
drivers/net/can/usb/ucan.c +1 -1
@@ -1397,7 +1397,7 @@ static int ucan_probe(struct usb_interface *intf,*/ /* 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) {
Sasha Levin
maintainerPATCH 1/2 can: ucan: fix typos in comments
From: Julia Lawall <[email protected]>
[ Upstream commit c34983c94166689358372d4af8d5def57752860c ]
Various spelling mistakes in comments.
Detected with the help of Coccinelle.
Stable-dep-of: fed4626501c8 ("can: ucan: fix devres lifetime")
--- drivers/net/can/usb/ucan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/usb/ucan.c +2 -2
@@ -1395,7 +1395,7 @@ static int ucan_probe(struct usb_interface *intf,* Stage 3 for the final driver initialisation. */ -/* Prepare Memory for control transferes */ +/* Prepare Memory for control transfers */ ctl_msg_buffer =devm_kzalloc (&udev->dev,sizeof (union ucan_ctl_payload ),GFP_KERNEL );
@@ -1529,7 +1529,7 @@ static int ucan_probe(struct usb_interface *intf, ret =ucan_device_request_in (up,UCAN_DEVICE_GET_FW_STRING ,0 ,sizeof (union ucan_ctl_payload ));if (ret >0 ) { -/* copy string while ensuring zero terminiation */ +/* copy string while ensuring zero termination */ strncpy (firmware_str, up->ctl_msg_buffer->raw,sizeof (union ucan_ctl_payload )); firmware_str[sizeof (union ucan_ctl_payload )] ='\0' ;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 can: ucan: fix devres lifetime
From: Johan Hovold <[email protected]>
[ Upstream commit fed4626501c871890da287bec62a96e52da1af89 ]
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.
--- drivers/net/can/usb/ucan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/usb/ucan.c +1 -1
@@ -1396,7 +1396,7 @@ static int ucan_probe(struct usb_interface *intf,*/ /* 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) {
Signature · 1 line
2.53.0