USB: pl2303: fix device initialisation at open
authorJohan Hovold <jhovold@gmail.com>
Mon, 10 Jun 2013 16:29:38 +0000 (18:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 13:44:26 +0000 (06:44 -0700)
commit8dc18301f5182ff47a3d2be364ca4d068efb575f
treeed9a71b98fcd531664090e44cb12fbf6dd59887d
parent9b5627d834131ed6c047bf7d9dc5e0aeeb769a86
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>
[bwh: Backported to 3.2: tty_struct::termios is a pointer, not a struct]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/pl2303.c