2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-18 02:24:21 +08:00

staging: rtl8712: Fix enqueue_reorder_recvframe()

The logic of this function was accidentally broken by a checkpatch
inspired cleanup.  I've modified the code to restore the original
behavior and also make checkpatch happy.

Fixes: 98fe05e21a ("staging: rtl8712: Remove unnecesary else after return statement.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200929103548.GA493135@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2020-09-29 13:35:48 +03:00 committed by Greg Kroah-Hartman
parent e6ac17de78
commit 29838144f2

View File

@ -476,11 +476,14 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
while (!end_of_queue_search(phead, plist)) { while (!end_of_queue_search(phead, plist)) {
pnextrframe = container_of(plist, union recv_frame, u.list); pnextrframe = container_of(plist, union recv_frame, u.list);
pnextattrib = &pnextrframe->u.hdr.attrib; pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
return false;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
plist = plist->next; plist = plist->next;
else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) else
return false; break;
break;
} }
list_del_init(&(prframe->u.hdr.list)); list_del_init(&(prframe->u.hdr.list));
list_add_tail(&(prframe->u.hdr.list), plist); list_add_tail(&(prframe->u.hdr.list), plist);