From nobody Sun Feb 8 16:12:28 2026 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 5B7DB13D891 for ; Tue, 23 Dec 2025 01:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766452667; cv=none; b=qzImKF4Yu28P1U9TodT3FiCSfikAYkvI/x5t2Xka38QTj6vc0auYGD5GT3gJBShl+5ABQKA0inNZSK4CFjh/BRfKY+cRN70JYV6n9JtKFgtuZcANFRNC5zmZSDcsO34ye8+Kuk85WKQPOas+KuyinASLewiFSdSffK308CZ7gXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766452667; c=relaxed/simple; bh=jT6hiLBq5q4z51RZFocOcIDwJLOFWMHSJ9DOh2olhbI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EqTYGa7nDoutQcL1D08Ol9ldGWve11k1dltKUa4HeTrDVfV8P7Ck7aRD4GxjEsIy5JybJMBcLA1iV+8W2WVYBu+0iQttQbAxnvqoBqpHWYXKuYyWGy2p+9KKGXbSkXdJefx64eLFF3/DBd4O0iKo4lnwiv8Dde5Zz+9WOQTMJsU= 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=m2jp6rqZ; arc=none smtp.client-ip=209.85.208.42 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="m2jp6rqZ" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-64951939e1eso6831900a12.1 for ; Mon, 22 Dec 2025 17:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766452664; x=1767057464; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dgl7WyQT1L+2/9hOch0QFHkfuodi/5zfl/ryOv/mbIE=; b=m2jp6rqZMGfSO5ex0LOmn2R30StxAQCc3ptlyytwbqEqAPrsVst6W5Umh8qIB20Gnz qgxFrc0vxmNTxd2ntWGuvBs18mqBASOIDc5Z3mQ3/waun5s7huKvFZNlKaDQRO+Zh6H0 SKTcRIS1uq0slxhTREVbXOjwHOpn40f5neAS5RR7z2j17U4Ne5i7sxU0mqFLhA+uduIn E6EeBM2VqLKa0YDB83N6x2cgYmtDRtDXBhCqrCrKfdNwf0n6yrKU+jFQzN4hUPor9XhG c+xdBNcvobGbE+M37dKaWl5lZUnmwxDIfi5KPW3sLiP/8f4cwJ1/qLA4NL0dFaOfIL92 B8SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766452664; x=1767057464; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Dgl7WyQT1L+2/9hOch0QFHkfuodi/5zfl/ryOv/mbIE=; b=tQevVSAwFeG8p1vU+kAOd7xkdY08KRFMr/2zH137q7Nooyf7LuafYlCCooz7J2DWeU 3hR91ihDC4Xfl/vYT206121wX3FxeuFBNmozGsmnnlrDQOWaNruxYMnHHO1d2X+/3oWD 61X98q5IiK/mS0XCOjbZ03C0ujhJvPweAvOnkLXXXxXqoTCeLNJCu3UfjxpwqIb61ImV dPNsGCHna5lUwnXJCn82/nDr4Vs2cgNkqE9EeF5T4x4tftdya0lmpwR5kgFXFUHvB3q1 mwTHfM+9KtRyfVXUJ62WpqLaprKuA15Vcg6EDLPgEuwiGQ/7zKx8xN2HNqjFK5rIW4Ou DuLQ== X-Forwarded-Encrypted: i=1; AJvYcCVzQADul1QulP5iPtmsXI00xZ1Hh7C0vZngq+h7OkMPpzk/aPws4u428Dse3oJSmKkjTS3/nBDpaC1FQIM=@vger.kernel.org X-Gm-Message-State: AOJu0YwjVL+Fj4ATG2ytCvXn42AcfmvuTTg5FR/UbH/MhR8b/GDBzgHH KvJmhT4lVTi5msD42d0UyV2E6YolXqcQQ0TTCtLOhBTuFbsfRqQk8B+3 X-Gm-Gg: AY/fxX4NfChn5ZHwcm7lY66Pw80YwgPUF4L/HQuWmXzjq8QtAgwBuUY6j7mjmkrY445 Se9sbdeNCBb6bZFaIcDq0kiPgCgNV60tOVkTAiij8V4nRisI8CrNRlo8CfJ1ikR4ebTrewftO58 0NBu91y6Flgi2hmOlZg0gFDLj87gvGuYi9iI5DROkEM34n8FyzWZ33ZDW7jF95e1SU3u9u1UwpS 9nGMydj1cGtDMTWTBl3QoaqpJBYkCMkUHiGhF2vEvccF8Wx3BE2bCAH2Tj+8CuxIH1eO3v+oCDP nM6hOaI6k4B7XEVpnv/zaah/ZakK7C4QZ8f8CBrAoS4+cY7l13vWq7s4+S/S+rUbW10rCnRMZeK fg57PpDXe/ce6FWRWhJqvDTe4fZ76qDSiALtW45maL9WwxBrBkwcX+5WOUWLpmJj5Xv/7ISs31a E= X-Google-Smtp-Source: AGHT+IGpl94Gzv/b9Ya4Ce30svn3/eP76iGOuseQDwrnjJp4YAVElMVa2HL226jZFYvOFfWc5SnLjQ== X-Received: by 2002:a17:907:9809:b0:b71:ea7c:e4ff with SMTP id a640c23a62f3a-b8036ec9e3emr1191177666b.6.1766452663440; Mon, 22 Dec 2025 17:17:43 -0800 (PST) Received: from prometheus ([85.11.110.37]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037a604f5sm1257217066b.11.2025.12.22.17.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Dec 2025 17:17:43 -0800 (PST) From: Szymon Wilczek To: mailhol@kernel.org, mkl@pengutronix.de Cc: linux-can@vger.kernel.org, linux-kernel@vger.kernel.org, Szymon Wilczek , syzbot+e8cb6691a7cf68256cb8@syzkaller.appspotmail.com Subject: [PATCH v2] can: etas_es58x: allow partial RX URB allocation to succeed Date: Tue, 23 Dec 2025 02:17:32 +0100 Message-ID: <20251223011732.39361-1-swilczek.lx@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251222154208.22117-1-swilczek.lx@gmail.com> References: <20251222154208.22117-1-swilczek.lx@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When es58x_alloc_rx_urbs() fails to allocate the requested number of URBs but succeeds in allocating some, it returns an error code. This causes es58x_open() to return early, skipping the cleanup label 'free_urbs', which leads to the anchored URBs being leaked. As pointed out by maintainer Vincent Mailhol, the driver is designed to handle partial URB allocation gracefully. Therefore, partial allocation should not be treated as a fatal error. Modify es58x_alloc_rx_urbs() to return 0 if at least one URB has been allocated, restoring the intended behavior and preventing the leak in es58x_open(). Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN = USB interfaces") Reported-by: syzbot+e8cb6691a7cf68256cb8@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3De8cb6691a7cf68256cb8 Signed-off-by: Szymon Wilczek Reviewed-by: Vincent Mailhol --- Changes in v2: - Replaced the cleanup fix in es58x_open() with the logic fix in es58x_alloc_rx_urbs() to treat partial allocation as success, as suggested by Vincent Mailhol. --- drivers/net/can/usb/etas_es58x/es58x_core.c | 2 +- 1 file changed, 1 insertion(+), 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 f799233c2b72..2d248deb69dc 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -1736,7 +1736,7 @@ static int es58x_alloc_rx_urbs(struct es58x_device *e= s58x_dev) dev_dbg(dev, "%s: Allocated %d rx URBs each of size %u\n", __func__, i, rx_buf_len); =20 - return ret; + return 0; } =20 /** --=20 2.52.0