net/smc: Fix searching in list of known pnetids in smc_pnet_add_pnetid
[ Upstream commit82ac39ebd6] pnetid of pi (not newly allocated pe) should be compared Fixes:e888a2e833("net/smc: introduce list of pnetids for Ethernet devices") Reviewed-by: D. Wythe <alibuda@linux.alibaba.com> Reviewed-by: Wen Gu <guwen@linux.alibaba.com> Signed-off-by: Li RongQing <lirongqing@baidu.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com> Link: https://patch.msgid.link/20241014115321.33234-1-lirongqing@baidu.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3e7b6d8c58
commit
51ecd8e4a2
+1
-1
@@ -749,7 +749,7 @@ static int smc_pnet_add_pnetid(struct net *net, u8 *pnetid)
|
||||
|
||||
write_lock(&sn->pnetids_ndev.lock);
|
||||
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);
|
||||
kfree(pe);
|
||||
goto unlock;
|
||||
|
||||
Reference in New Issue
Block a user