Skip to content

Commit

Permalink
net/smc: Fix searching in list of known pnetids in smc_pnet_add_pnetid
Browse files Browse the repository at this point in the history
pnetid of pi (not newly allocated pe) should be compared

Fixes: e888a2e ("net/smc: introduce list of pnetids for Ethernet devices")
Reviewed-by: D. Wythe <[email protected]>
Reviewed-by: Wen Gu <[email protected]>
Signed-off-by: Li RongQing <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Gerd Bayer <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
lrq-max authored and kuba-moo committed Oct 15, 2024
1 parent d0c3601 commit 82ac39e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/smc/smc_pnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,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;
Expand Down

0 comments on commit 82ac39e

Please sign in to comment.