[PATCH 1/9] Fix buffer overflow in ni_usb_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  The writes buffer size was taking into accont the number of
  entries causing random oopses.

Signed-off-by: Dave Penkler <dpenkler@xxxxxxxxx>
---
 drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
index 571f07800c9a..9ff56b063681 100644
--- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
@@ -1726,7 +1726,7 @@ static int ni_usb_init(gpib_board_t *board)
 	unsigned int ibsta;
 	int writes_len;
 
-	writes = kmalloc(sizeof(*writes), GFP_KERNEL);
+	writes = kmalloc(sizeof(*writes) * NUM_INIT_WRITES, GFP_KERNEL);
 	if (!writes)
 		return -ENOMEM;
 
-- 
2.46.2





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux