]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: gpib: Fix faulty workaround for assignment in if
authorDave Penkler <dpenkler@gmail.com>
Wed, 4 Dec 2024 14:57:13 +0000 (15:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2024 15:58:33 +0000 (16:58 +0100)
This was detected by Coverity.

Add the missing assignment in the else branch of the if

Reported-by: Kees Bakker <kees@ijzerbout.nl>
Fixes: fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver")
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20241204145713.11889-5-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c

index 796c3a5be54513ab0f40694bb7229760a0b3e606..267651a15fa00e8925c4d08a95e2f61206e76a61 100644 (file)
@@ -901,7 +901,7 @@ static int usb_gpib_read(gpib_board_t *board,
 
                } else {
                        /* we are in the closing <DLE><ETX> sequence */
-
+                       c = nc;
                        if (c == ETX) {
                                c = one_char(board, &b);
                                if (c == ACK) {