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 652BC1DE4E0; Mon, 23 Mar 2026 14:57:32 +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=1774277852; cv=none; b=UIm7ST+eysG8IX76qfQZFwhFwI2i/nsNh2EdgMZkEqoe2ooTFfWE0k71FoJ5EkGwXwMynaEB9O3+sg3ptoJNMVHv+9LPxmNI7QG2mP8fYsEMZSarY8DEl74MOBhA1HhRQZyg54BUDQkIwCENgBmSX0qK7WZSZ77Temgbu3xxJIk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277852; c=relaxed/simple; bh=XN4QqYocYh13Ptqce3mbpgm+t3sq/lXJPkwjI/b/VbY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VNDuTarPKlhfluh3p+ChUX9ay3hM0X6DHmAXEJqqJ5QK+WswvhMAvqmeJAkeBaAy1qI2/trEOgx+cyxbcs2eoYv0oadDGfqXAFjMxVJXyyuJaJcfTYGAROoZo/SFuhNm5YE7dAVOZJqJTe4OP/vWPUBY5RXj8f6wMV7ojqrnDFA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rfFo9j5K; 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="rfFo9j5K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC2F1C2BC9E; Mon, 23 Mar 2026 14:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774277852; bh=XN4QqYocYh13Ptqce3mbpgm+t3sq/lXJPkwjI/b/VbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rfFo9j5K3HnpDbmvtg/X+icwj4X1CdVmdrXGRSH9YoLSs+QC5LEwzoJZFuDiisL8p JUTs2RO+A9+KQA2hgpzc6jfKtYGtWCrV16THLSNIE3GzV738qYcOuUZCvxEbBSKFpI XNo3CfSFpCHlh7tBzvgaMfkglvz5bzFm5DV86edg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vincent Mailhol , Marc Kleine-Budde , stable@kernel.org Subject: [PATCH 6.6 096/567] can: usb: etas_es58x: correctly anchor the urb in the read bulk callback Date: Mon, 23 Mar 2026 14:40:16 +0100 Message-ID: <20260323134536.204858378@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134533.749096647@linuxfoundation.org> References: <20260323134533.749096647@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org 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: Greg Kroah-Hartman commit 5eaad4f768266f1f17e01232ffe2ef009f8129b7 upstream. When submitting an urb, that is using the anchor pattern, it needs to be anchored before submitting it otherwise it could be leaked if usb_kill_anchored_urbs() is called. This logic is correctly done elsewhere in the driver, except in the read bulk callback so do that here also. Cc: Vincent Mailhol Cc: Marc Kleine-Budde Cc: stable@kernel.org Assisted-by: gkh_clanker_2000 Signed-off-by: Greg Kroah-Hartman Reviewed-by: Vincent Mailhol Tested-by: Vincent Mailhol Link: https://patch.msgid.link/2026022320-poser-stiffly-9d84@gregkh Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces") Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/etas_es58x/es58x_core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -1461,12 +1461,18 @@ static void es58x_read_bulk_callback(str } resubmit_urb: + usb_anchor_urb(urb, &es58x_dev->rx_urbs); ret = usb_submit_urb(urb, GFP_ATOMIC); + if (!ret) + return; + + usb_unanchor_urb(urb); + if (ret == -ENODEV) { for (i = 0; i < es58x_dev->num_can_ch; i++) if (es58x_dev->netdev[i]) netif_device_detach(es58x_dev->netdev[i]); - } else if (ret) + } else dev_err_ratelimited(dev, "Failed resubmitting read bulk urb: %pe\n", ERR_PTR(ret));