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 92DE53FB7D3 for ; Fri, 15 May 2026 08:27:41 +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=1778833661; cv=none; b=edXczOmfPzg4sFQ3q6mY2M2RTC7xMR4SZtT573SPCigdZ/87fW3OyYN3izzGlXOIYCI2G8TiUfpcsJAF+hYgEMmAAXhBhKWgxZUeDZu2+OyvpFC1lWBgsOqCLEmScx6jWtJ9stDcDGJU3AME6YSPuHeAwp/Gwdu0/OPyv1PCVVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778833661; c=relaxed/simple; bh=Ac2IQgh/IpwGE4H5m3qw/kFK5Xu7xyf1YVz86fNmFng=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=iQoI4xUpG1wwzgWfnKO6Gfkw6PFKHLyB3cyJ8w2I1OOY5hCI+PuZcUh7GiRYxzLT1TowWXdvyXRvlw+Kbg6L9bnQRD5X3Q3OPe8UPCYh/hoWAF9ZsewohDYT27LIK+wOxQnpbcXnNmIbUtJ/E3ll+GINAc3B/M5h030SQsGZW9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=B3g6JGbj; 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="B3g6JGbj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8A4DC2BCB0; Fri, 15 May 2026 08:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778833661; bh=Ac2IQgh/IpwGE4H5m3qw/kFK5Xu7xyf1YVz86fNmFng=; h=Subject:To:Cc:From:Date:From; b=B3g6JGbj9B+iUczxEqR45vAkEnNrXCtV//D+90sg4As6VizQyqhXSdRfX8IPXqpIf 7bC41T+S7mmZNfvdNhWPsldQeIhcL/2+MxRwHhJ2Tgp3Kpw0gQDp49MdqeewWAgYst rSrgUKq8MLs0yNS1asa27tbwc01vrasUbLtlwWGw= Subject: FAILED: patch "[PATCH] spi: ch341: fix devres lifetime" failed to apply to 6.12-stable tree To: johan@kernel.org,broonie@kernel.org,jth@kernel.org Cc: From: Date: Fri, 15 May 2026 10:27:45 +0200 Message-ID: <2026051545-hemlock-october-cd7a@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-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 . 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-6.12.y git checkout FETCH_HEAD git cherry-pick -x abe572f630bc1f0e77041012ab075869036ede4f # git commit -s git send-email --to '' --in-reply-to '2026051545-hemlock-october-cd7a@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From abe572f630bc1f0e77041012ab075869036ede4f Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 27 Mar 2026 11:43:05 +0100 Subject: [PATCH] spi: ch341: 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 controller and driver data lifetime so that they are released on driver unbind. Note that this also makes sure that the SPI controller is placed correctly under the USB interface in the device tree. Fixes: 8846739f52af ("spi: add ch341a usb2spi driver") Cc: stable@vger.kernel.org # 6.11 Cc: Johannes Thumshirn Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260327104305.1309915-3-johan@kernel.org Signed-off-by: Mark Brown diff --git a/drivers/spi/spi-ch341.c b/drivers/spi/spi-ch341.c index ded093566260..3eaa8f176f63 100644 --- a/drivers/spi/spi-ch341.c +++ b/drivers/spi/spi-ch341.c @@ -152,7 +152,7 @@ static int ch341_probe(struct usb_interface *intf, if (ret) return ret; - ctrl = devm_spi_alloc_host(&udev->dev, sizeof(struct ch341_spi_dev)); + ctrl = devm_spi_alloc_host(&intf->dev, sizeof(struct ch341_spi_dev)); if (!ctrl) return -ENOMEM; @@ -163,7 +163,7 @@ static int ch341_probe(struct usb_interface *intf, ch341->read_pipe = usb_rcvbulkpipe(udev, usb_endpoint_num(in)); ch341->rx_len = usb_endpoint_maxp(in); - ch341->rx_buf = devm_kzalloc(&udev->dev, ch341->rx_len, GFP_KERNEL); + ch341->rx_buf = devm_kzalloc(&intf->dev, ch341->rx_len, GFP_KERNEL); if (!ch341->rx_buf) return -ENOMEM; @@ -171,8 +171,7 @@ static int ch341_probe(struct usb_interface *intf, if (!ch341->rx_urb) return -ENOMEM; - ch341->tx_buf = - devm_kzalloc(&udev->dev, CH341_PACKET_LENGTH, GFP_KERNEL); + ch341->tx_buf = devm_kzalloc(&intf->dev, CH341_PACKET_LENGTH, GFP_KERNEL); if (!ch341->tx_buf) { ret = -ENOMEM; goto err_free_urb;