Skip to content

Commit 242439f

Browse files
ian-abbottgregkh
authored andcommitted
comedi: vmk80xx: fix expression for tx buffer size
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]>
1 parent f2906aa commit 242439f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/comedi/drivers/vmk80xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev)
684684
if (!devpriv->usb_rx_buf)
685685
return -ENOMEM;
686686

687-
size = max(usb_endpoint_maxp(devpriv->ep_rx), MIN_BUF_SIZE);
687+
size = max(usb_endpoint_maxp(devpriv->ep_tx), MIN_BUF_SIZE);
688688
devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL);
689689
if (!devpriv->usb_tx_buf)
690690
return -ENOMEM;

0 commit comments

Comments
 (0)