diff options
| author | Dave Penkler <[email protected]> | 2025-05-02 07:09:39 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-05-02 07:28:54 +0000 |
| commit | cac01bd178d6a2a23727f138d647ce1a0e8a73a1 (patch) | |
| tree | 9fc1390fed84af22a65500570b85e61b07573c25 /rust/helpers/mutex.c | |
| parent | usb: typec: tcpm: delay SNK_TRY_WAIT_DEBOUNCE to SRC_TRYWAIT transition (diff) | |
| download | kernel-cac01bd178d6a2a23727f138d647ce1a0e8a73a1.tar.gz kernel-cac01bd178d6a2a23727f138d647ce1a0e8a73a1.zip | |
usb: usbtmc: Fix erroneous get_stb ioctl error returns
wait_event_interruptible_timeout returns a long
The return was being assigned to an int causing an integer overflow when
the remaining jiffies > INT_MAX resulting in random error returns.
Use a long return value and convert to int ioctl return only on error.
When the return value of wait_event_interruptible_timeout was <= INT_MAX
the number of remaining jiffies was returned which has no meaning for the
user. Return 0 on success.
Reported-by: Michael Katzmann <[email protected]>
Fixes: dbf3e7f654c0 ("Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.")
Cc: [email protected]
Signed-off-by: Dave Penkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'rust/helpers/mutex.c')
0 files changed, 0 insertions, 0 deletions
