]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2013 03:46:35 +0000 (19:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2013 03:46:35 +0000 (19:46 -0800)
added patches:
can-kvaser_usb-fix-usb-endpoints-detection.patch
usb-mos7840-fix-tiocmget-error-handling.patch

queue-3.10/can-kvaser_usb-fix-usb-endpoints-detection.patch [new file with mode: 0644]
queue-3.10/series
queue-3.10/usb-mos7840-fix-tiocmget-error-handling.patch [new file with mode: 0644]

diff --git a/queue-3.10/can-kvaser_usb-fix-usb-endpoints-detection.patch b/queue-3.10/can-kvaser_usb-fix-usb-endpoints-detection.patch
new file mode 100644 (file)
index 0000000..f5b4e4e
--- /dev/null
@@ -0,0 +1,69 @@
+From 896e23bd04ea50a146dffd342e2f96180f0812a5 Mon Sep 17 00:00:00 2001
+From: Olivier Sobrie <olivier@sobrie.be>
+Date: Sun, 27 Oct 2013 22:07:53 +0100
+Subject: can: kvaser_usb: fix usb endpoints detection
+
+From: Olivier Sobrie <olivier@sobrie.be>
+
+commit 896e23bd04ea50a146dffd342e2f96180f0812a5 upstream.
+
+Some devices, like the Kvaser Memorator Professional, have several bulk in
+endpoints. Only the first one found must be used by the driver. The same holds
+for the bulk out endpoint. The official Kvaser driver (leaf) was used as
+reference for this patch.
+
+Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/can/usb/kvaser_usb.c |   20 +++++++++++++-------
+ 1 file changed, 13 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/can/usb/kvaser_usb.c
++++ b/drivers/net/can/usb/kvaser_usb.c
+@@ -1544,9 +1544,9 @@ static int kvaser_usb_init_one(struct us
+       return 0;
+ }
+-static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
+-                                   struct usb_endpoint_descriptor **in,
+-                                   struct usb_endpoint_descriptor **out)
++static int kvaser_usb_get_endpoints(const struct usb_interface *intf,
++                                  struct usb_endpoint_descriptor **in,
++                                  struct usb_endpoint_descriptor **out)
+ {
+       const struct usb_host_interface *iface_desc;
+       struct usb_endpoint_descriptor *endpoint;
+@@ -1557,12 +1557,18 @@ static void kvaser_usb_get_endpoints(con
+       for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
+               endpoint = &iface_desc->endpoint[i].desc;
+-              if (usb_endpoint_is_bulk_in(endpoint))
++              if (!*in && usb_endpoint_is_bulk_in(endpoint))
+                       *in = endpoint;
+-              if (usb_endpoint_is_bulk_out(endpoint))
++              if (!*out && usb_endpoint_is_bulk_out(endpoint))
+                       *out = endpoint;
++
++              /* use first bulk endpoint for in and out */
++              if (*in && *out)
++                      return 0;
+       }
++
++      return -ENODEV;
+ }
+ static int kvaser_usb_probe(struct usb_interface *intf,
+@@ -1576,8 +1582,8 @@ static int kvaser_usb_probe(struct usb_i
+       if (!dev)
+               return -ENOMEM;
+-      kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
+-      if (!dev->bulk_in || !dev->bulk_out) {
++      err = kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
++      if (err) {
+               dev_err(&intf->dev, "Cannot get usb endpoint(s)");
+               return err;
+       }
index dbcdbe4eda3cc9c5e04b65d1041b5819e109fc32..86c55e541bbd8d6e6367055842148c9d41b59dfd 100644 (file)
@@ -3,3 +3,5 @@ libertas-potential-oops-in-debugfs.patch
 aacraid-prevent-invalid-pointer-dereference.patch
 acpica-return-error-if-derefof-resolves-to-a-null-package-element.patch
 acpica-fix-for-a-store-argx-when-argx-contains-a-reference-to-a-field.patch
+usb-mos7840-fix-tiocmget-error-handling.patch
+can-kvaser_usb-fix-usb-endpoints-detection.patch
diff --git a/queue-3.10/usb-mos7840-fix-tiocmget-error-handling.patch b/queue-3.10/usb-mos7840-fix-tiocmget-error-handling.patch
new file mode 100644 (file)
index 0000000..3f0ece2
--- /dev/null
@@ -0,0 +1,33 @@
+From a91ccd26e75235d86248d018fe3779732bcafd8d Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Wed, 9 Oct 2013 17:01:09 +0200
+Subject: USB: mos7840: fix tiocmget error handling
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit a91ccd26e75235d86248d018fe3779732bcafd8d upstream.
+
+Make sure to return errors from tiocmget rather than rely on
+uninitialised stack data.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/mos7840.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/serial/mos7840.c
++++ b/drivers/usb/serial/mos7840.c
+@@ -1593,7 +1593,11 @@ static int mos7840_tiocmget(struct tty_s
+               return -ENODEV;
+       status = mos7840_get_uart_reg(port, MODEM_STATUS_REGISTER, &msr);
++      if (status != 1)
++              return -EIO;
+       status = mos7840_get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr);
++      if (status != 1)
++              return -EIO;
+       result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0)
+           | ((mcr & MCR_RTS) ? TIOCM_RTS : 0)
+           | ((mcr & MCR_LOOPBACK) ? TIOCM_LOOP : 0)