Thread (8 messages) flat view 8 messages, 4 authors, 2d ago

Re: [PATCH net-next v2] ch9200: do return USB errors from control_write()

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-09-19 01:21:25
Also in: linux-usb, lkml

On Wed, 16 Sep 2026 19:21:04 +0300 Sergey Shtylyov wrote:
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.
We have too many patches in flight these days to be chasing people's
linked series. Too many LLM-happy "helpers".

Please explain how you discovered the issue and how you tested the fix.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help