summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_wr.c
diff options
context:
space:
mode:
authorDavid S. Miller2018-11-22 01:14:56 +0100
committerDavid S. Miller2018-11-22 01:14:56 +0100
commit395048ebd4547d3cced71807b8aabfbde000fe55 (patch)
tree7325b43e2c0690f4f0944ae97096fda4cadefade /net/smc/smc_wr.c
parentMerge tag 'wireless-drivers-for-davem-2018-11-20' of git://git.kernel.org/pub... (diff)
parentnet/smc: use after free fix in smc_wr_tx_put_slot() (diff)
downloadkernel-qcow2-linux-395048ebd4547d3cced71807b8aabfbde000fe55.tar.gz
kernel-qcow2-linux-395048ebd4547d3cced71807b8aabfbde000fe55.tar.xz
kernel-qcow2-linux-395048ebd4547d3cced71807b8aabfbde000fe55.zip
Merge branch 'smc-fixes'
Ursula Braun says: ==================== net/smc: fixes 2018-11-12 here is V4 of some net/smc fixes in different areas for the net tree. v1->v2: do not define 8-byte alignment for union smcd_cdc_cursor in patch 4/5 "net/smc: atomic SMCD cursor handling" v2->v3: stay with 8-byte alignment for union smcd_cdc_cursor in patch 4/5 "net/smc: atomic SMCD cursor handling", but get rid of __packed for struct smcd_cdc_msg v3->v4: get rid of another __packed for struct smc_cdc_msg in patch 4/5 "net/smc: atomic SMCD cursor handling" ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_wr.c')
-rw-r--r--net/smc/smc_wr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c
index 3c458d279855..c2694750a6a8 100644
--- a/net/smc/smc_wr.c
+++ b/net/smc/smc_wr.c
@@ -215,12 +215,14 @@ int smc_wr_tx_put_slot(struct smc_link *link,
pend = container_of(wr_pend_priv, struct smc_wr_tx_pend, priv);
if (pend->idx < link->wr_tx_cnt) {
+ u32 idx = pend->idx;
+
/* clear the full struct smc_wr_tx_pend including .priv */
memset(&link->wr_tx_pends[pend->idx], 0,
sizeof(link->wr_tx_pends[pend->idx]));
memset(&link->wr_tx_bufs[pend->idx], 0,
sizeof(link->wr_tx_bufs[pend->idx]));
- test_and_clear_bit(pend->idx, link->wr_tx_mask);
+ test_and_clear_bit(idx, link->wr_tx_mask);
return 1;
}