]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
sierra_net: Skip validating irrelevant fields for IDLE LSIs
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Wed, 24 May 2017 01:53:42 +0000 (21:53 -0400)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 27 Jun 2017 13:16:35 +0000 (10:16 -0300)
BugLink: http://bugs.launchpad.net/bugs/1698817
[ Upstream commit 764895d3039e903dac3a70f219949efe43d036a0 ]

When the context is deactivated, the link_type is set to 0xff, which
triggers a warning message, and results in a wrong link status, as
the LSI is ignored.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/usb/sierra_net.c

index a251588762ec6aa4053ec8af337e714411ec877c..d997d24798f024a327b15c0d82abb923e65ea07a 100644 (file)
@@ -365,6 +365,13 @@ static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
                return -1;
        }
 
+       /* Validate the session state */
+       if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
+               netdev_err(dev->net, "Session idle, 0x%02x\n",
+                          lsi->session_state);
+               return 0;
+       }
+
        /* Validate the protocol  - only support UMTS for now */
        if (lsi->protocol != SIERRA_NET_PROTOCOL_UMTS) {
                netdev_err(dev->net, "Protocol unsupported, 0x%02x\n",
@@ -386,13 +393,6 @@ static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
                return 0;
        }
 
-       /* Validate the session state */
-       if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
-               netdev_err(dev->net, "Session idle, 0x%02x\n",
-                       lsi->session_state);
-               return 0;
-       }
-
        /* Set link_sense true */
        return 1;
 }