Commit c47bcff9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: rtl8188eu: use safe iterator in wakeup_sta_to_xmit()

These two loops call list_del_init() on the list iterator so they need to
use the _safe() iterator to prevent a forever loop.

Fixes: 23017c88 ("staging: rtl8188eu: Use list iterators and helpers")
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YL5i1ZAAAB4vSWef@mwandaSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0f489a2
...@@ -1796,17 +1796,14 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) ...@@ -1796,17 +1796,14 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
{ {
u8 update_mask = 0, wmmps_ac = 0; u8 update_mask = 0, wmmps_ac = 0;
struct sta_info *psta_bmc; struct sta_info *psta_bmc;
struct list_head *xmitframe_plist, *xmitframe_phead; struct list_head *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe, *n;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
spin_lock_bh(&psta->sleep_q.lock); spin_lock_bh(&psta->sleep_q.lock);
xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_phead = get_list_head(&psta->sleep_q);
list_for_each(xmitframe_plist, xmitframe_phead) { list_for_each_entry_safe(pxmitframe, n, xmitframe_phead, list) {
pxmitframe = list_entry(xmitframe_plist, struct xmit_frame,
list);
list_del_init(&pxmitframe->list); list_del_init(&pxmitframe->list);
switch (pxmitframe->attrib.priority) { switch (pxmitframe->attrib.priority) {
...@@ -1881,10 +1878,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) ...@@ -1881,10 +1878,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
spin_lock_bh(&psta_bmc->sleep_q.lock); spin_lock_bh(&psta_bmc->sleep_q.lock);
xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
list_for_each(xmitframe_plist, xmitframe_phead) { list_for_each_entry_safe(pxmitframe, n, xmitframe_phead, list) {
pxmitframe = list_entry(xmitframe_plist,
struct xmit_frame, list);
list_del_init(&pxmitframe->list); list_del_init(&pxmitframe->list);
psta_bmc->sleepq_len--; psta_bmc->sleepq_len--;
......
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