Commit 6305f498 authored by David Woodhouse's avatar David Woodhouse Committed by John W. Linville

libertas: fix sanity check on sequence number in command response

Slightly more useful if we compare it against the sequence number of the
command we have outstanding, rather than comparing the reply with itself.

Doh. Pointed out by Sebastian Siewior
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c2f2d3a0
...@@ -572,9 +572,9 @@ int lbs_process_rx_command(struct lbs_private *priv) ...@@ -572,9 +572,9 @@ int lbs_process_rx_command(struct lbs_private *priv)
respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies); respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies);
lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len); lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len);
if (resp->seqnum != resp->seqnum) { if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum)); le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1; ret = -1;
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment