Skip to content

Commit

Permalink
USB: serial: ir-usb: Silence harmless uninitialized variable warning
Browse files Browse the repository at this point in the history
The "actual_length" variable might be uninitialized on some failure
paths.  It's harmless but static analysis tools like Smatch complain
and at runtime the UBSan tool will likely complain as well.

Fixes: e7542bc ("USB: serial: ir-usb: make set_termios synchronous")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Dan Carpenter authored and Johan Hovold committed Feb 10, 2020
1 parent bb6d3fb commit c664a4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/serial/ir-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static void ir_set_termios(struct tty_struct *tty,
usb_sndbulkpipe(udev, port->bulk_out_endpointAddress),
transfer_buffer, 1, &actual_length, 5000);
if (ret || actual_length != 1) {
if (actual_length != 1)
if (!ret)
ret = -EIO;
dev_err(&port->dev, "failed to change line speed: %d\n", ret);
}
Expand Down

0 comments on commit c664a4f

Please sign in to comment.