]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: core: usb_submit_urb: downgrade type check
authorOliver Neukum <oneukum@suse.com>
Thu, 12 Jun 2025 12:20:25 +0000 (14:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:03 +0000 (18:41 +0200)
[ Upstream commit 503bbde34cc3dd2acd231f277ba70c3f9ed22e59 ]

Checking for the endpoint type is no reason for a WARN, as that can
cause a reboot. A driver not checking the endpoint type must not cause a
reboot, as there is just no point in this.  We cannot prevent a device
from doing something incorrect as a reaction to a transfer. Hence
warning for a mere assumption being wrong is not sensible.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20250612122149.2559724-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/core/urb.c

index 5e52a35486afbe58bdffd3dfc1eb5964a9471ade..120de3c499d2266e6c31844bc391514400ee8ef2 100644 (file)
@@ -500,7 +500,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
 
        /* Check that the pipe's type matches the endpoint's type */
        if (usb_pipe_type_check(urb->dev, urb->pipe))
-               dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
+               dev_warn_once(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
                        usb_pipetype(urb->pipe), pipetypes[xfertype]);
 
        /* Check against a simple/standard policy */