]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix using of uninitialized completions
authorKarsten Graul <kgraul@linux.ibm.com>
Mon, 27 Dec 2021 13:35:30 +0000 (14:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Dec 2021 14:46:17 +0000 (14:46 +0000)
commitacef1629a2b3d79f5a7c0baa571aa6bbcb2fabf9
tree5d0710bc18de96399506cd99e77f045c10defd99
parentfd7e7839fcbc193463c6b2422e32f20224165309
net/smc: fix using of uninitialized completions

In smc_wr_tx_send_wait() the completion on index specified by
pend->idx is initialized and after smc_wr_tx_send() was called the wait
for completion starts. pend->idx is used to get the correct index for
the wait, but the pend structure could already be cleared in
smc_wr_tx_process_cqe().
Introduce pnd_idx to hold and use a local copy of the correct index.

Fixes: e75e89afc1d1 ("net/smc: wait for departure of an IB message")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_wr.c