hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Linux device driver for RTL8187
34 *
....@@ -14,10 +15,6 @@
1415 *
1516 * Magic delays and register offsets below are taken from the original
1617 * r8187 driver sources. Thanks to Realtek for their support!
17
- *
18
- * This program is free software; you can redistribute it and/or modify
19
- * it under the terms of the GNU General Public License version 2 as
20
- * published by the Free Software Foundation.
2118 */
2219
2320 #include <linux/usb.h>
....@@ -500,7 +497,7 @@
500497 if (cmd_type == 1) {
501498 unsigned int pkt_rc, seq_no;
502499 bool tok;
503
- struct sk_buff *skb;
500
+ struct sk_buff *skb, *iter;
504501 struct ieee80211_hdr *ieee80211hdr;
505502 unsigned long flags;
506503
....@@ -509,8 +506,9 @@
509506 seq_no = (val >> 16) & 0xFFF;
510507
511508 spin_lock_irqsave(&priv->b_tx_status.queue.lock, flags);
512
- skb_queue_reverse_walk(&priv->b_tx_status.queue, skb) {
513
- ieee80211hdr = (struct ieee80211_hdr *)skb->data;
509
+ skb = NULL;
510
+ skb_queue_reverse_walk(&priv->b_tx_status.queue, iter) {
511
+ ieee80211hdr = (struct ieee80211_hdr *)iter->data;
514512
515513 /*
516514 * While testing, it was discovered that the seq_no
....@@ -523,10 +521,12 @@
523521 * it's unlikely we wrongly ack some sent data
524522 */
525523 if ((le16_to_cpu(ieee80211hdr->seq_ctrl)
526
- & 0xFFF) == seq_no)
524
+ & 0xFFF) == seq_no) {
525
+ skb = iter;
527526 break;
527
+ }
528528 }
529
- if (skb != (struct sk_buff *) &priv->b_tx_status.queue) {
529
+ if (skb) {
530530 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
531531
532532 __skb_unlink(skb, &priv->b_tx_status.queue);