Re: [PATCH] USB:bugfix a controller halt error

From: Oliver Neukum
Date: Mon Jul 24 2023 - 08:35:36 EST


On 21.07.23 16:57, Alan Stern wrote:
There is a flaw in your reasoning.

The operation carried out here is deliberately unsafe (for full-speed
devices). It is made before we know the actual maxpacket size for ep0,
and as a result it might return an error code even when it works okay.
This shouldn't happen, but a lot of USB hardware is unreliable.

Therefore we must not ignore the result merely because r < 0. If we do
that, the kernel might stop working with some devices.

Right. However, we must make sure we are operating on controlled results.
As is we are operating on a random buffer without checking an IO operation
has been performed on it.

Regards
Oliver