From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19DC515A864 for ; Mon, 6 Jul 2026 01:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783301622; cv=none; b=Z6jNgKQOVBKzZovVIq5+IoOEqvXw/33MzXEkjmZ3cS8yxQ9B3gQxIaLfyuLMTvfmUEdAdDlx+J2HVIykh0mgOLq/az8TqUwrJHBa1LLzTW4u4Qmu0KbrP9nLkbImoJb1aWGyv50I/3Y/gIqejp+87YO/EXop5QeKZBGaxxoItkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783301622; c=relaxed/simple; bh=lMO2qkJ2/muvyHs+GtY/dK5mTATd4Yu4Q7K9tJ0DNA0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ATZXAqaiGnklhnmgR3oEr2bjt8fVxwf3mP9x12m1x10lxYuht4CJNi7adeGJRjit7L8OSuPVmqdefcxx5cRR3tBD/ZjKm+2zRZlogbgYdRmpEJYuiLtvrXpQ1HM9xvVxg5DDxDHosyX+UXZBdK040/dAiVMFFpe58h3UUeIK6As= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fjG8GY+P; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fjG8GY+P" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-845c92bc464so1573591b3a.2 for ; Sun, 05 Jul 2026 18:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783301620; x=1783906420; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=jreECMEQiShowkS9piQE/YnsH0rmBC8VLhOIRsTmMP0=; b=fjG8GY+P+Sd6ERBCiwm4alhRhoQIMKq2Kdh0JySVMU5GUNpy1z/cNhSnVrrA//U/Gi x1vbmf6OJyimM0of64djy0qUQ1CCEb1bCyQpewJtoXNXIxascFSxGGr3AiUBlZScZDzT Q1QH/FA8dIk6xDt4Yl8qhj2zTgfPOXI9IlYfZ/gXsv3bCIFk2EC5b5dAoVptYwRaxGgI S2Gmcq1QzsFjaLcGb+/gGKAtbN4OpePTjCe5CL6wO04zBipFLUA5yyputqJ+WD7fOW5i pLDIW52Y7X5deMgnv40qMopXUuYVrRRhEPVekx1L0w++rOrlNs0hrqSIl72c7hE5z4Ux tdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783301620; x=1783906420; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jreECMEQiShowkS9piQE/YnsH0rmBC8VLhOIRsTmMP0=; b=HHVub33iUJQF9GrtSQ2kipVKc4kEtdNoywEM9wGme9wrc9nLd8sxsRdaU2zUiy1yWO 5K/HNUnnEuqRr7YVestKQix3HEYcfbFkXEokg2+tkV24B7spEk5+9BJ4IDg7F1nvY7Zs 5RnuzXk0/4KYAP67+zJOFmyeq40HLDBxD5qdjSG4CN744y+mcqUm9M1zPehWN6RW86T9 xVGLXuCAHuS2F6QAEm6WqqH9mrS/ynYbRaDw2CPv431Wc3C5IGTKyA1i8wdmRK3oVnse bji45CA0HyJsxQb1e3W6zVStIrLzddLdjVK5P2Jj03CFI+WmJ9SkKGwng9xkK8P7QF1P UO4w== X-Forwarded-Encrypted: i=1; AHgh+Rqf/qqjyBpd6inuEmr9bmcTcfzE4IM1HL040HS5JBbWd13a9yFUWZRT0iwce5VYlN418wtLN2xnu6KjgZA=@vger.kernel.org X-Gm-Message-State: AOJu0Yxkc7iYO8w5RgLL979PotKfqFIFRLCseb8Ckr7LNwoRfwB5LHee 1lm+0jTG6+S6/mEj3q+zy5lRHpfPhHr4XrQr6EoIpqEsxl8Q6XpfjVUi X-Gm-Gg: AfdE7clFg2Ptk0rDQhmMRYGAMNvjim29XCWiGrzANmQhfQJnqTMAd+qPucdvUMqkgo6 LkTLbuEYe5o1zO0i4jI6jDIetnTWCvulrdK+k68lhNm71l+o8ebbhxhT/7NrXcSvEpFhKZ1hgVu nZMDfEZ0Wuxnc+CrbmoPQzWUilBPMcVGFbhGC9M24EOv1wTACWSejl5yGqVUahrIIQJ0nUYTBM/ J0wTyjjDnoGZos0uA9gUQfGyepRwCMrBFHY1JbalTiiPmSz1HzxPFe4Dx09noHim1f9vApZev6u VjckS+j0oao+ltSBTm7eoSPyYxgh2FFdCSh/ts7rRt4xz3aH8oBR9Bmlgwo6gP3dYMTO3jUNl7d 0fT1/2taDfHhVfU1JdADg2WeFghGLrc4HMu9n0fmzXqBo8Uc+PPVvT7LhIrl6OIw2b7aWjCEn3Z 6xYC4= X-Received: by 2002:a05:6a00:428a:b0:82d:62ed:b01d with SMTP id d2e1a72fcca58-847f6f474c0mr6953470b3a.45.1783301620471; Sun, 05 Jul 2026 18:33:40 -0700 (PDT) Received: from lgs.. ([152.32.214.178]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6d76106sm2823159b3a.40.2026.07.05.18.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2026 18:33:40 -0700 (PDT) From: Guangshuo Li To: Vincent Mailhol , Marc Kleine-Budde , Greg Kroah-Hartman , linux-can@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Guangshuo Li Subject: [PATCH v2] can: usb: etas_es58x: Fix RX buffer leak on URB resubmit failure Date: Mon, 6 Jul 2026 09:33:22 +0800 Message-ID: <20260706013322.360792-1-lgs201920130244@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit es58x_read_bulk_callback() resubmits the RX URB after processing a received packet. If the resubmit succeeds, the URB remains anchored and will be handled by the normal RX path or by teardown. However, if usb_submit_urb() fails, the callback unanchors the URB and then returns directly. This skips the existing free_urb path, so the coherent transfer buffer allocated with usb_alloc_coherent() is not released. Reuse the existing free_urb path after a resubmit failure so that the RX coherent buffer is freed before leaving the callback. Fixes: 5eaad4f76826 ("can: usb: etas_es58x: correctly anchor the urb in the read bulk callback") Signed-off-by: Guangshuo Li Reviewed-by: Vincent Mailhol --- drivers/net/can/usb/etas_es58x/es58x_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c index da12a35dd2f9..e1724ae79c5a 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -1476,7 +1476,6 @@ static void es58x_read_bulk_callback(struct urb *urb) dev_err_ratelimited(dev, "Failed resubmitting read bulk urb: %pe\n", ERR_PTR(ret)); - goto free_urb; free_urb: usb_free_coherent(urb->dev, urb->transfer_buffer_length, -- 2.43.0