Commit 82ac39eb authored by Li RongQing's avatar Li RongQing Committed by Jakub Kicinski

net/smc: Fix searching in list of known pnetids in smc_pnet_add_pnetid

pnetid of pi (not newly allocated pe) should be compared

Fixes: e888a2e8 ("net/smc: introduce list of pnetids for Ethernet devices")
Reviewed-by: default avatarD. Wythe <alibuda@linux.alibaba.com>
Reviewed-by: default avatarWen Gu <guwen@linux.alibaba.com>
Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarGerd Bayer <gbayer@linux.ibm.com>
Link: https://patch.msgid.link/20241014115321.33234-1-lirongqing@baidu.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d0c3601f
...@@ -753,7 +753,7 @@ static int smc_pnet_add_pnetid(struct net *net, u8 *pnetid) ...@@ -753,7 +753,7 @@ static int smc_pnet_add_pnetid(struct net *net, u8 *pnetid)
write_lock(&sn->pnetids_ndev.lock); write_lock(&sn->pnetids_ndev.lock);
list_for_each_entry(pi, &sn->pnetids_ndev.list, list) { list_for_each_entry(pi, &sn->pnetids_ndev.list, list) {
if (smc_pnet_match(pnetid, pe->pnetid)) { if (smc_pnet_match(pnetid, pi->pnetid)) {
refcount_inc(&pi->refcnt); refcount_inc(&pi->refcnt);
kfree(pe); kfree(pe);
goto unlock; goto unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment