Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpib: Fix error code in ni_usb_write_registers()

If ni_usb_receive_bulk_msg() succeeds but without reading 16 bytes, then
the error code needs to be set. The current code returns success.

Fixes: 4e127de14fa7 ("staging: gpib: Add National Instruments USB GPIB driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aSlMpbE4IrQuBGFS@stanley.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
484e6225 96118565

+1 -1
+1 -1
drivers/gpib/ni_usb/ni_usb_gpib.c
··· 566 566 retval, bytes_read); 567 567 ni_usb_dump_raw_block(in_data, bytes_read); 568 568 kfree(in_data); 569 - return retval; 569 + return retval ?: -EINVAL; 570 570 } 571 571 572 572 mutex_unlock(&ni_priv->addressed_transfer_lock);