aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-05-29 11:57:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-12 19:09:50 -0400
commit4273f9878b0a8271df055e3c8f2e7f08c6a4a2f4 (patch)
treef76d15c047835477134a31d80dc6135c9659f748 /drivers/usb
parent1aa3c63cf0a79153ee13c8f82e4eb6c40b66a161 (diff)
USB: option: fix port-data abuse
Commit 8b4c6a3ab596961b78465 ("USB: option: Use generic USB wwan code") moved option port-data allocation to usb_wwan_startup but still cast the port data to the old struct... Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/option.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index d9cb5526368c..9c2f7b28e254 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1265,35 +1265,6 @@ static struct usb_serial_driver * const serial_drivers[] = {
1265 1265
1266static bool debug; 1266static bool debug;
1267 1267
1268/* per port private data */
1269
1270#define N_IN_URB 4
1271#define N_OUT_URB 4
1272#define IN_BUFLEN 4096
1273#define OUT_BUFLEN 4096
1274
1275struct option_port_private {
1276 /* Input endpoints and buffer for this port */
1277 struct urb *in_urbs[N_IN_URB];
1278 u8 *in_buffer[N_IN_URB];
1279 /* Output endpoints and buffer for this port */
1280 struct urb *out_urbs[N_OUT_URB];
1281 u8 *out_buffer[N_OUT_URB];
1282 unsigned long out_busy; /* Bit vector of URBs in use */
1283 int opened;
1284 struct usb_anchor delayed;
1285
1286 /* Settings for the port */
1287 int rts_state; /* Handshaking pins (outputs) */
1288 int dtr_state;
1289 int cts_state; /* Handshaking pins (inputs) */
1290 int dsr_state;
1291 int dcd_state;
1292 int ri_state;
1293
1294 unsigned long tx_start_time[N_OUT_URB];
1295};
1296
1297module_usb_serial_driver(serial_drivers, option_ids); 1268module_usb_serial_driver(serial_drivers, option_ids);
1298 1269
1299static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, 1270static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason,
@@ -1367,7 +1338,8 @@ static void option_instat_callback(struct urb *urb)
1367 int err; 1338 int err;
1368 int status = urb->status; 1339 int status = urb->status;
1369 struct usb_serial_port *port = urb->context; 1340 struct usb_serial_port *port = urb->context;
1370 struct option_port_private *portdata = usb_get_serial_port_data(port); 1341 struct usb_wwan_port_private *portdata =
1342 usb_get_serial_port_data(port);
1371 1343
1372 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); 1344 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata);
1373 1345
@@ -1427,7 +1399,7 @@ static int option_send_setup(struct usb_serial_port *port)
1427 struct usb_serial *serial = port->serial; 1399 struct usb_serial *serial = port->serial;
1428 struct usb_wwan_intf_private *intfdata = 1400 struct usb_wwan_intf_private *intfdata =
1429 (struct usb_wwan_intf_private *) serial->private; 1401 (struct usb_wwan_intf_private *) serial->private;
1430 struct option_port_private *portdata; 1402 struct usb_wwan_port_private *portdata;
1431 int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; 1403 int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
1432 int val = 0; 1404 int val = 0;
1433 1405