USB: pl2303: fix device initialisation at open
authorJohan Hovold <jhovold@gmail.com>
Mon, 10 Jun 2013 16:29:38 +0000 (18:29 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Jun 2013 01:17:02 +0000 (02:17 +0100)
commit0f9613bfc25a11c5ed61c2213031b209381619cc
treedfdcebc2e8a451b5d7abed494b20e92bfab48c7c
parent9e5adb3632ba5664767ff5f41d3f584d9de102b8
USB: pl2303: fix device initialisation at open

commit 2d8f4447b58bba5f8cb895c07690434c02307eaf upstream.

Do not use uninitialised termios data to determine when to configure the
device at open.

This also prevents stack data from leaking to userspace in the OOM error
path.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: tty_struct::termios is a pointer, not a struct]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/pl2303.c