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

USB: serial: ir-usb: Silence harmless uninitialized variable warning

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: e7542bc382f8 ("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>

authored by

Dan Carpenter and committed by
Johan Hovold
c664a4fa bb6d3fb3

+1 -1
+1 -1
drivers/usb/serial/ir-usb.c
··· 448 448 usb_sndbulkpipe(udev, port->bulk_out_endpointAddress), 449 449 transfer_buffer, 1, &actual_length, 5000); 450 450 if (ret || actual_length != 1) { 451 - if (actual_length != 1) 451 + if (!ret) 452 452 ret = -EIO; 453 453 dev_err(&port->dev, "failed to change line speed: %d\n", ret); 454 454 }