summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2022-06-07 18:18:19 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-22 14:13:18 +0200
commit308b8f31c069d5545c06f8e6bab6bd5bd139bfed (patch)
treee9c8b852fad051036f36c6b826285bb65d5b0f44
parent9308be3d9a74d29d41c39f52d588ba009c8f9a75 (diff)
downloadlinux-stable-308b8f31c069d5545c06f8e6bab6bd5bd139bfed.tar.gz
linux-stable-308b8f31c069d5545c06f8e6bab6bd5bd139bfed.tar.bz2
linux-stable-308b8f31c069d5545c06f8e6bab6bd5bd139bfed.zip
comedi: vmk80xx: fix expression for tx buffer size
commit 242439f7e279d86b3f73b5de724bc67b2f8aeb07 upstream. 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: a23461c47482 ("comedi: vmk80xx: fix transfer-buffer overflow") Cc: Johan Hovold <johan@kernel.org> Cc: stable@vger.kernel.org # 4.9+ Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20220607171819.4121-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/vmk80xx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
index 7769eadfaf61..ccc65cfc519f 100644
--- a/drivers/staging/comedi/drivers/vmk80xx.c
+++ b/drivers/staging/comedi/drivers/vmk80xx.c
@@ -685,7 +685,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;