Commit 35bdf9a
nfc: Fix hangup of RC-S380* in port100_send_ack()
commit 2497128 upstream.
If port100_send_ack() was called twice or more, it has race to hangup.
port100_send_ack() port100_send_ack()
init_completion()
[...]
dev->cmd_cancel = true
/* this removes previous from completion */
init_completion()
[...]
dev->cmd_cancel = true
wait_for_completion()
/* never be waked up */
wait_for_completion()
Like above race, this code is not assuming port100_send_ack() is
called twice or more.
To fix, this checks dev->cmd_cancel to know if prior cancel is
in-flight or not. And never be remove prior task from completion by
using reinit_completion(), so this guarantees to be waked up properly
soon or later.
Signed-off-by: OGAWA Hirofumi <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Signed-off-by: Amit Pundir <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 6b3d13f commit 35bdf9a
1 file changed
+23
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
733 | 741 | | |
734 | | - | |
| 742 | + | |
735 | 743 | | |
736 | | - | |
737 | | - | |
738 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
739 | 747 | | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
745 | 755 | | |
746 | 756 | | |
747 | 757 | | |
| |||
928 | 938 | | |
929 | 939 | | |
930 | 940 | | |
| 941 | + | |
931 | 942 | | |
932 | | - | |
933 | 943 | | |
934 | 944 | | |
935 | 945 | | |
| |||
1543 | 1553 | | |
1544 | 1554 | | |
1545 | 1555 | | |
| 1556 | + | |
1546 | 1557 | | |
1547 | 1558 | | |
1548 | 1559 | | |
| |||
0 commit comments