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>
Thu, 25 Nov 2021 08:48:35 +0000 (09:48 +0100)
commitf6218db543517082b45f553b39f7731d6535126c
tree667e414f5b98d5a8d0b7c3654eb58ac53d754bd6
parent17b2c2e70d20da15d02140796f5dc28160137a2c
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