Skip to content

usb: usbtmc: Fix erroneous ioctl returns

Dave Penkler linux-usb stable 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/23 patches 0 repliesNew
  2. v3 posting 1/21 of 3 patches 1 replySuperseded
  3. v2 posting 2/22 of 3 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/21 of 3 patches0 repliesSuperseded
v13 patches1 replySuperseded

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: usbtmc: Fix erroneous get_stb ioctl error returnsdrivers/usb/class/usbtmc.c+8 -40 replies
2/3usb: usbtmc: Fix erroneous wait_srq ioctl returndrivers/usb/class/usbtmc.c+11 -120 replies
3/3usb: usbtmc: Fix erroneous generic_read ioctl returndrivers/usb/class/usbtmc.c+12 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH 0/3 V3] usb: usbtmc: Fix erroneous ioctl returns

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
V2 => V3 Add susbsystem to cover letter
2.49.0