Skip to content

Commit d95ffdd

Browse files
StefanBruensgregkh
authored andcommitted
sierra_net: Skip validating irrelevant fields for IDLE LSIs
[ 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>
1 parent 716cca0 commit d95ffdd

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/net/usb/sierra_net.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,13 @@ static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
365365
return -1;
366366
}
367367

368+
/* Validate the session state */
369+
if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
370+
netdev_err(dev->net, "Session idle, 0x%02x\n",
371+
lsi->session_state);
372+
return 0;
373+
}
374+
368375
/* Validate the protocol - only support UMTS for now */
369376
if (lsi->protocol != SIERRA_NET_PROTOCOL_UMTS) {
370377
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)
386393
return 0;
387394
}
388395

389-
/* Validate the session state */
390-
if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
391-
netdev_err(dev->net, "Session idle, 0x%02x\n",
392-
lsi->session_state);
393-
return 0;
394-
}
395-
396396
/* Set link_sense true */
397397
return 1;
398398
}

0 commit comments

Comments
 (0)