Skip to content

Commit 4be0ae3

Browse files
jhovoldgregkh
authored andcommitted
USB: serial: mct_u232: fix big-endian baud-rate handling
commit 26cede343656c0bc2c33cdc783771282405c7fb2 upstream. Drop erroneous cpu_to_le32 when setting the baud rate, something which corrupted the divisor on big-endian hosts. Found using sparse: warning: incorrect type in argument 1 (different base types) expected unsigned int [unsigned] [usertype] val got restricted __le32 [usertype] <noident> Fixes: af2ac1a ("USB: serial mct_usb232: move DMA buffers to heap") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-By: Pete Zaitcev <zaitcev@yahoo.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 704f23f commit 4be0ae3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/usb/serial/mct_u232.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,
189189
return -ENOMEM;
190190

191191
divisor = mct_u232_calculate_baud_rate(serial, value, &speed);
192-
put_unaligned_le32(cpu_to_le32(divisor), buf);
192+
put_unaligned_le32(divisor, buf);
193193
rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
194194
MCT_U232_SET_BAUD_RATE_REQUEST,
195195
MCT_U232_SET_REQUEST_TYPE,

0 commit comments

Comments
 (0)