Skip to content

Commit

Permalink
comedi: vmk80xx: fix expression for tx buffer size
Browse files Browse the repository at this point in the history
The expression for setting the size of the allocated bulk TX buffer
(`devpriv->usb_tx_buf`) is calling `usb_endpoint_maxp(devpriv->ep_rx)`,
which is using the wrong endpoint (should be `devpriv->ep_tx`).  Fix it.

Fixes: a23461c ("comedi: vmk80xx: fix transfer-buffer overflow")
Cc: Johan Hovold <[email protected]>
Cc: [email protected] # 4.9+
Reviewed-by: Johan Hovold <[email protected]>
Signed-off-by: Ian Abbott <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ian-abbott authored and gregkh committed Jun 10, 2022
1 parent f2906aa commit 242439f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/comedi/drivers/vmk80xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev)
if (!devpriv->usb_rx_buf)
return -ENOMEM;

size = max(usb_endpoint_maxp(devpriv->ep_rx), MIN_BUF_SIZE);
size = max(usb_endpoint_maxp(devpriv->ep_tx), MIN_BUF_SIZE);
devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL);
if (!devpriv->usb_tx_buf)
return -ENOMEM;
Expand Down

0 comments on commit 242439f

Please sign in to comment.