Article View: linux.kernel.netdev
Article #25277[PATCH net-next 8/9] can: gs_usb: gs_usb_receive_bulk_callback(): use dev_info_ratelimited() to print re-submit info messages
From: Marc Kleine-Budde
Date: Tue, 01 Dec 2026 13:03
Date: Tue, 01 Dec 2026 13:03
56 lines
12053 bytes
12053 bytes
If an URB is retransmitted (due to an error) before the network device can
be identified, and if this retransmission fails, netdev_info() operates
with a NULL pointer for the network device. Although this does not cause a
system crash, it does not provide any information about which device is
affected.
Replace net_ratelimit and netdev_info() with dev_info_ratelimited() to
output the affected USB device.
While there, remove the NULL pointer initialization for netdev, as it's not
longer needed.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260729102802.505168-1-mkl@pengutronix.de
Fixes: 79a6d1bfe114 ("can: gs_usb: gs_usb_receive_bulk_callback(): unanchor URL on usb_submit_urb() error")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261201-gs_usb-fixes-v13-8-f28c5cf468da@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/usb/gs_usb.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index c48a8e97c3ab..40d867b830cf 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -633,11 +633,11 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
{
struct gs_usb *parent = urb->context;
struct gs_can *dev;
- struct net_device *netdev = NULL;
int rc;
struct net_device_stats *stats;
struct gs_host_frame *hf = urb->transfer_buffer;
unsigned int minimum_length, data_length;
+ struct net_device *netdev;
struct gs_tx_context *txc;
struct can_frame *cf;
struct canfd_frame *cfd;
@@ -797,9 +797,10 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
if (parent->canch[rc])
netif_device_detach(parent->canch[rc]->netdev);
}
- } else if (rc != -ESHUTDOWN && net_ratelimit()) {
- netdev_info(netdev, "failed to re-submit IN URB: %pe\n",
- ERR_PTR(rc));
+ } else if (rc != -ESHUTDOWN) {
+ dev_info_ratelimited(&parent->udev->dev,
+ "failed to re-submit IN URB: %pe\n",
+ ERR_PTR(rc));
}
}
--
2.53.0
Technical Details
Message-ID:
<20261201130450.2195418-9-mkl@pengutronix.de>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375082-linux-kernel-netdev=dewy.ruReferences:
<20261201130450.2195418-1-mkl@pengutronix.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375082-linux-kernel-netdev=dewy.ru From: mkl@pengutronix.de (Marc Kleine-Budde) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 8/9] can: gs_usb: gs_usb_receive_bulk_callback(): use dev_info_ratelimited() to print re-submit info messages Date: Tue, 1 Dec 2026 14:03:02 +0100 Organization: Usenet Network Message-ID: <20261201130450.2195418-9-mkl@pengutronix.de> References: <20261201130450.2195418-1-mkl@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1717155"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:/mKQB85LANOhGXIpunUJeFW3BgI= sha256:NV2T+ex1RRNxtEoOxZ3o1TRkDJcwjEjqOdx6vvicDgw= sha1:qzTy7bevoiVwUplrQkJ82r6Gsq0= sha256:lva0lATaf4txanb1M8CmYHWEc6tsPS6HnqsZsYyL1TM= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id AF14F1173A9; Tue, 1 Dec 2026 16:06:13 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=pengutronix.de X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xjApnR0Htw6m; Tue, 1 Dec 2026 16:06:10 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375082-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pengutronix.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 11ECB117361; Tue, 1 Dec 2026 16:06:02 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id BF5252F469; Tue, 1 Dec 2026 13:05:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796130342; b=HhCfR63RPOQ1PX9bBJRBHiSqTxLR8D/hEBVVFtIupgcykZ8X5DinSWtlV4WKeBAb3+d9 rSZpXDinyCMoExhvrlok42G7AlEPdlKZ62eWnY0JRzvS5hAxj1Uhh3NBkX/NSW7no66L2 rrOAcTPQe1smiVKprbdDrXvmp+aTEbSmKM4A7ab284oKIyhg4RGQ+K1mwaNFMTmNmo3VI hR6GmWUmv8Ik1JZ0Mabh3cz896YyyvSbIzoUuOmalLc1ns8oYkA/vYM9vtfkExBUq2XYe PomgUQFMttdGXlITOvXW9BkMwAC5iPTh7OxSIEP+jqhE2MFz7QLGOj7IQIP8cNzdScQ== X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796130342; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=LY7HtZtnrCkSG5tk5tkZCKD1ZIVVDAWuqNN+WBv2Ols=; b=vQPVw7ayAzq3VXwe6f1V1NaCFQezBBbLZNUT06m0z5O5hrouYRA6m6ZPAnJmKasPJ2ou lzb7hh9lJXXj7H+jbmBtFr2Y5UR3yCyxys1KsTSyUaWwdyTmwN89Wl2B5kUgxLHy+LYLk XoDJvk+ovVfRDy1ASl80UcfDKF+qvsFknTcTJwlb7sWIH1oGwnSI8+KgLzuxGrS2uEHJ9 XNprTrJ8zCh3eVwycBzwWp1C5kN4PvNQBoV9G0A3k8d6M3+SIHFGRXDNkVaCPLW20hpKI VJnvsk/aKYOPkg9wYBvT09tRhqhR4FV6VpQVp6osBfUuBI2jm3rBR5W5unrrSrXUDEA== X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=VqXcte+s; dmarc=none header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82F1F606A334; Tue, 1 Dec 2026 13:05:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=VqXcte+s X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796130341; b=bBCONoU7lP1pDrrUkps0Oof8HMa4zXZWm6XuEWWsy9gbS0xXqSkWob/5dPI7MBwwd338 n3ZMoTOeQLQyRMe3BvuCNVdlflh/muWn1M1M6b9oEaOdlL4RVKbDOPY1gmSA6qdozgrBv od+bhv/gYOF/WW/MmDU01zW5LpXXPX2RDNUC7cns6Vn4gKd9xHAP5noe3XeznRXR7WUG2 X1kicwqv25xC2m2O71HZQUgdCxXTtqGZPj6zSb5ZPxs4mX6KBpCP8hMlvu+7hIzLr2kCU jkC0cSdFRMpwy/S58YE+u8AhAWAGzxaANuSvai3EXpAOEBdUbr/dT+AyizH+m/5laGA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796130341; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=LY7HtZtnrCkSG5tk5tkZCKD1ZIVVDAWuqNN+WBv2Ols=; b=cuLY2CDw/rwFvf7S+L0+egP63avQtc+lrF935Ew07W0V3MCoT5T+59G3KT3aqy8Zxoly TCtWoBpvfGC6bDizcGkWyXkzZnafVe/z8Iid+vdGx9bFP/DFkCzluGSOCxm8+l4dRHBXf zaccuQ96dLdrz98zna2+1f3aIifJWQpvT4w/IaKY8COVE69l0TG3p2xXh+esD+yoPO1gL CH5X5Y7iAMt18EPWT8pLskDttf3HmbUl1/bbwIyd5Mx2Iw5GZ4ZMBaJShAbGZ3yY72BEY v2OYFpc2UVGUyUwtn0Xa0Zcjr4pM5s2+jEX8+ZMYBkgiqAfSuVZAg+pTjDXhUtmOkjg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=VqXcte+s; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13 X-Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B157606A325; Tue, 1 Dec 2026 13:05:40 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2B157606A325 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de X-Received: from pengutronix.de (p20030102af17cb00c4330b233ae7cbb8.dip0.t-ipconnect.de [IPv6:2003:102:af17:cb00:c433:b23:3ae7:cbb8]) (Authenticated sender: mkl@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 2277B20284F; Tue, 01 Dec 2026 14:05:35 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1796130335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LY7HtZtnrCkSG5tk5tkZCKD1ZIVVDAWuqNN+WBv2Ols=; b=VqXcte+s1I5t30TKsmTZZLgDySQfX0uOSLO18gnEvYe4qpWrZprAMn061WUqm+HPWsqdI7 gwHdBoCD++0X3FBjGVOLBFh2fxBlflYcRr089dH5FyNV89UwAex51Q5Eg3/XVg0Gl+w46Z 5kivzgitfc1L+za/QM6A4rgikoeOrYKVk7oDcv5Ro7Z2KsMrBvke9jPbVx2CMzt7YsLeGW SPWUqya9DSnXfKCJnEcmNTsDU6pac5m4CRdeeAnSpCW5Bk75f9eMP53Mvea+KMVheeiOqU FDd/p0NHVAu5QKYAvF1Ewwo/7cxcNPSFCPaXlCGcMPRnLKZ8fdGLXKn6dURK9w== X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1796130335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LY7HtZtnrCkSG5tk5tkZCKD1ZIVVDAWuqNN+WBv2Ols=; b=S0D4PmnSEzjdgSs2WubqYnObPWPIWIcUXA8oEBhY8BL0Mwfs1lvn0O44FXw1E/yg3/j1p5 6gDXnTueEI+O4PvDPZCtRwJV8ISi1xES1JDbM/qQUw9EDrTZ501xZ1WRL/x9lEczhggtXk FA2vtOQZq/ztNCY9F+ry0oQzgwrZwlkUapONjBmRoethTXNs8CvJf3Sri8di52WqvlPzL1 2IiEeZ/8r38CIshnjBbBiTg6GciLLGvo08e7613n1KC7GSt3O+J2820wK0KmltnEZeWb4f RCih/hTVGw9mZAfO1iCkEpzdVKP5IUXsWeYNgTbZt6nisv++3n2ZxPrUlS8x2Q== X-ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=mkl@pengutronix.de smtp.mailfrom=mkl@pengutronix.de X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1796130335; a=rsa-sha256; cv=none; b=QwB3jWDcPoRyqBueudfAfyNHEY7ZnoU32xaBLtrveWrrb93+J4Uyp0dCsDpKssunYD6dfJ 26FTEZzoDIVPTPRtsLz2I1dVGfRt8yCSRiuJ4ArtqB26sceRiyYa7DWgZfiN9AssxXSoSW ZaNEORoMix34N2mKcGtHm+4BsQGxkp0woia1kSx4AlRd8vwvu+J6wrjIn5M8lpdLNE6UUU /BN2MU9zYK4+xCK7BwCW2UKcvjGF3qAEeYvzLM+/x+Ebuq+ucNsC0q5h0PAeum2h8+5RKJ eqywQpGEuTga2y4gliz6QsekfUk4vMJTO+ZKk5NH0smWYLuf/mtQWD9EdqW0Jg== X-Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, kernel@pengutronix.de, Vincent Mailhol <mailhol@kernel.org>, Marc Kleine-Budde <mkl@pengutronix.de>, Sashiko <sashiko-bot@kernel.org>, stable@vger.kernel.org X-Mailer: git-send-email 2.53.0 X-In-Reply-To: <20261201130450.2195418-1-mkl@pengutronix.de> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list