Re: [PATCH net-next v2] ch9200: do return USB errors from control_write()
From: Sergey Shtylyov <hidden>
Date: 2026-09-21 19:59:19
Also in:
linux-usb, lkml
On 9/19/26 4:21 AM, Jakub Kicinski wrote: [...]
quoted
quoted
There is a second point about the resulting contract. On success usb_control_msg() returns the transferred length, so control_write() now returns a positive value (2 for these register writes) rather than 0: err = usb_control_msg(dev->udev, ...); if (err >= 0 && err < size) err = -EINVAL; Would the obvious caller-side follow-up "if (retval) return retval;" then treat every successful 2-byte register write as a failure? Would it be better to normalize success to 0 in control_write(), or to check "retval < 0" in each caller and update the callers in the same patch so the errors being returned are actually acted upon?That's what the patch I linked to does...Please fix the issues in one series or not at all.
OK. Series against net-next, right?
We have too many patches in flight these days to be chasing people's linked series. Too many LLM-happy "helpers".
IMHO these 2 patches are not so heavily linked, that's why I posted them separately... And no AI was involved, of course. :-)
Please explain how you discovered the issue and how you tested the fix.
As I noted in the description of the patch [1], the issue was reported by the static analyzer. For the patch [2], I saw a problem with my own eyes. I don't have the hardware, so no testing; there was some hope that e.g. Matthew Garret (the driver's original submitter) could be able to test but his email bounced... [1] https://lore.kernel.org/all/20260914202503.52920-1-s.shtylyov@auroraos.dev/ (local) [2] https://lore.kernel.org/all/20260915185805.38712-1-s.shtylyov@auroraos.dev/ (local) MBR, Sergey