Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575108

[PATCH 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs

From Stefan Brüns <stefan.bruens@rwth-aachen.de>
Newsgroups linux.kernel
Subject [PATCH 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs
Date 2017-02-06 21:30 +0100
Message-ID <t7Y5c-1m6-7@gated-at.bofh.it> (permalink)
References <t7Y5c-1m6-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/net/usb/sierra_net.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 8c2a16c28ec1..567c7a0bb30e 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -387,6 +387,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) {
 		struct lsi_umts_single *single = (struct lsi_umts_single *)lsi;
@@ -420,13 +427,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;
 }
-- 
2.11.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-02-06 21:30 +0100

csiph-web