net/smc: Introduce a new conn->lgr validity check helper
authorWen Gu <guwen@linux.alibaba.com>
Thu, 13 Jan 2022 08:36:41 +0000 (16:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Jan 2022 13:14:53 +0000 (13:14 +0000)
commitea89c6c0983c39702a4a52ccaa4702e0cb71179b
tree9e8c99b82d0eeaee64d464df07eacc135608cfcf
parent91341fa0003befd097e190ec2a4bf63ad957c49a
net/smc: Introduce a new conn->lgr validity check helper

It is no longer suitable to identify whether a smc connection
is registered in a link group through checking if conn->lgr
is NULL, because conn->lgr won't be reset even the connection
is unregistered from a link group.

So this patch introduces a new helper smc_conn_lgr_valid() and
replaces all the check of conn->lgr in original implementation
with the new helper to judge if conn->lgr is valid to use.

Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c
net/smc/smc_cdc.c
net/smc/smc_clc.c
net/smc/smc_core.c
net/smc/smc_core.h
net/smc/smc_diag.c