mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 04:21:03 -04:00
staging: gpib: fix uninitialized variable in usb_gpib_command()
The number of bytes written is supposed to be zero at the start of this
function but only one caller, ibcmd(), initializes it to zero. For the
other three callers, setup_serial_poll(), read_serial_poll_byte() and
cleanup_serial_poll(), it's an uninitialized variable.
Fixes: fce79512a9 ("staging: gpib: Add LPVO DIY USB GPIB driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/a7fed100-ea4d-4dd8-97c6-3fbd2c15f795@stanley.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cbf821e689
commit
1f6bfe18d0
@@ -597,6 +597,7 @@ static int usb_gpib_command(gpib_board_t *board,
|
||||
|
||||
set_timeout(board);
|
||||
|
||||
*bytes_written = 0;
|
||||
for (i = 0 ; i < length ; i++) {
|
||||
command[3] = buffer[i];
|
||||
retval = send_command(board, command, 5);
|
||||
|
||||
Reference in New Issue
Block a user