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


Groups > linux.kernel > #1575332 > unrolled thread

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

Started byStefan Brüns <stefan.bruens@rwth-aachen.de>
First post2017-02-07 03:40 +0100
Last post2017-02-07 20:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-02-07 03:40 +0100
    Re: [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields  for IDLE LSIs David Miller <davem@davemloft.net> - 2017-02-07 20:10 +0100

#1575332 — [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs

FromStefan Brüns <stefan.bruens@rwth-aachen.de>
Date2017-02-07 03:40 +0100
Subject[PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs
Message-ID<t83Rg-50z-13@gated-at.bofh.it>
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 977afe74ed54..e9e14263ff0a 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -385,6 +385,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;
@@ -418,13 +425,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

[toc] | [next] | [standalone]


#1575969 — Re: [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs

FromDavid Miller <davem@davemloft.net>
Date2017-02-07 20:10 +0100
SubjectRe: [PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs
Message-ID<t8jjl-6Qz-35@gated-at.bofh.it>
In reply to#1575332
From: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Date: Tue, 7 Feb 2017 03:33:17 +0100

> 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>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web