提交 c664a4fa 编写于 作者: D Dan Carpenter 提交者: Johan Hovold

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: e7542bc3 ("USB: serial: ir-usb: make set_termios synchronous")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJohan Hovold <johan@kernel.org>
上级 bb6d3fb3
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册