[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220607171819.4121-1-abbotti@mev.co.uk>
Date: Tue, 7 Jun 2022 18:18:19 +0100
From: Ian Abbott <abbotti@....co.uk>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ian Abbott <abbotti@....co.uk>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Johan Hovold <johan@...nel.org>, stable@...r.kernel.org
Subject: [PATCH v2] 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: a23461c47482 ("comedi: vmk80xx: fix transfer-buffer overflow")
Cc: Johan Hovold <johan@...nel.org>
Cc: stable@...r.kernel.org # 4.9+
Signed-off-by: Ian Abbott <abbotti@....co.uk>
Reviewed-by: Johan Hovold <johan@...nel.org>
---
v2: Amended Cc: stable@...r.kernel.org line to apply to 4.9+.
Added Reviewed-by: Johan Hovold
drivers/comedi/drivers/vmk80xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/comedi/drivers/vmk80xx.c b/drivers/comedi/drivers/vmk80xx.c
index 46023adc5395..4536ed43f65b 100644
--- a/drivers/comedi/drivers/vmk80xx.c
+++ b/drivers/comedi/drivers/vmk80xx.c
@@ -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;
--
2.35.1
Powered by blists - more mailing lists