Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 98fe05e21a6e ("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>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
29838144 e6ac17de

+6 -3
+6 -3
drivers/staging/rtl8712/rtl8712_recv.c
··· 476 476 while (!end_of_queue_search(phead, plist)) { 477 477 pnextrframe = container_of(plist, union recv_frame, u.list); 478 478 pnextattrib = &pnextrframe->u.hdr.attrib; 479 + 480 + if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) 481 + return false; 482 + 479 483 if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) 480 484 plist = plist->next; 481 - else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) 482 - return false; 483 - break; 485 + else 486 + break; 484 487 } 485 488 list_del_init(&(prframe->u.hdr.list)); 486 489 list_add_tail(&(prframe->u.hdr.list), plist);