OSDN Git Service

[PATCH] usb-serial: Fix data corruption with usb serial emulation
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 17 Sep 2008 22:04:21 +0000 (22:04 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 17 Sep 2008 22:04:21 +0000 (22:04 +0000)
commit8109b9b6bf934a39e73c90fb804e2d5af02391d1
treef9c873330599c5ede5540ed21bd46436a234113a
parent49237acdb725ef6d709aa8cb81fd1b13afa59064
[PATCH] usb-serial: Fix data corruption with usb serial emulation

* Remove the unused send_buf variable and its constant.

* Fix a math error
  The variables recv_ptr and recv_used are not large enough to hold
  the constant 384, which causes data corruption when the pointer is
  reset with: s->recv_ptr = (s->recv_ptr + len) % RECV_BUF;

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5242 c046a42c-6fe2-441c-8c8c-71466251a162
hw/usb-serial.c