Patch "ibmvnic: initialize rc before completing wait" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ibmvnic: initialize rc before completing wait

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ibmvnic-initialize-rc-before-completing-wait.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 54950130f768f2d2a0977e6f4f4b0257580ebbb6
Author: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxx>
Date:   Thu Feb 24 22:23:52 2022 -0800

    ibmvnic: initialize rc before completing wait
    
    [ Upstream commit 765559b10ce514eb1576595834f23cdc92125fee ]
    
    We should initialize ->init_done_rc before calling complete(). Otherwise
    the waiting thread may see ->init_done_rc as 0 before we have updated it
    and may assume that the CRQ was successful.
    
    Fixes: 6b278c0cb378 ("ibmvnic delay complete()")
    Signed-off-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 996da870dafe..945a84c2134f 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -5319,9 +5319,9 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
 			}
 
 			if (!completion_done(&adapter->init_done)) {
-				complete(&adapter->init_done);
 				if (!adapter->init_done_rc)
 					adapter->init_done_rc = -EAGAIN;
+				complete(&adapter->init_done);
 			}
 
 			break;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux