linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3 V2] Fix erroneous ioctl returns
@ 2025-04-27  7:30 Dave Penkler
  2025-04-27  7:30 ` [PATCH 1/3 V3] usb: usbtmc: Fix erroneous get_stb ioctl error returns Dave Penkler
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dave Penkler @ 2025-04-27  7:30 UTC (permalink / raw)
  To: gregkh, linux-usb; +Cc: guido.kiener, stable, Dave Penkler

Recent tests with timeouts > INT_MAX produced random error returns
with usbtmc_get_stb. This was caused by assigning the return value
of wait_event_interruptible_timeout to an int which overflowed to
negative values. Also return value on success was the remaining
number of jiffies instead of 0.

These patches fix all the cases where the return of
wait_event_interruptible_timeout was assigned to an int and
the case of the remaining jiffies return in usbtmc_get_stb.

Patch 1: Fixes usbtmc_get_stb 
Patch 2: Fixes usbtmc488_ioctl_wait_srq
Patch 3: Fixes usbtmc_generic_read

Dave Penkler (3):
  usb: usbtmc: Fix erroneous get_stb ioctl error returns
  usb: usbtmc: Fix erroneous wait_srq ioctl return
  usb: usbtmc: Fix erroneous generic_read ioctl return

 drivers/usb/class/usbtmc.c | 53 ++++++++++++++++++++++----------------
 1 file changed, 31 insertions(+), 22 deletions(-)

--
Changes V1 => V2 Add cc to stable line
2.49.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-27  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-27  7:30 [PATCH 0/3 V2] Fix erroneous ioctl returns Dave Penkler
2025-04-27  7:30 ` [PATCH 1/3 V3] usb: usbtmc: Fix erroneous get_stb ioctl error returns Dave Penkler
2025-04-27  7:30 ` [PATCH 2/3 V2] usb: usbtmc: Fix erroneous wait_srq ioctl return Dave Penkler
2025-04-27  7:30 ` [PATCH 3/3 V2] usb: usbtmc: Fix erroneous generic_read " Dave Penkler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).