net/smc: Make sure the link_id is unique
authorWen Gu <guwen@linux.alibaba.com>
Mon, 15 Nov 2021 09:45:07 +0000 (17:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 09:39:15 +0000 (10:39 +0100)
commit09decd0a102a2a85018aca9038267387e23ab65b
tree16d9e0deae7b8d10759b60edaf86143426c5e73a
parent437e21e2c9ae5a29ea1509df12705964e191954f
net/smc: Make sure the link_id is unique

[ Upstream commit cf4f5530bb55ef7d5a91036b26676643b80b1616 ]

The link_id is supposed to be unique, but smcr_next_link_id() doesn't
skip the used link_id as expected. So the patch fixes this.

Fixes: 026c381fb477 ("net/smc: introduce link_idx for link group array")
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/smc/smc_core.c