Thread (1 message) 1 message, 1 author, 2024-10-12

Re: [PATCH] net/smc: fix wrong comparation in smc_pnet_add_pnetid

From: Wen Gu <guwen@linux.alibaba.com>
Date: 2024-10-12 07:50:09
Also in: linux-s390


On 2024/10/11 14:19, Li RongQing wrote:
quoted hunk
pnetid of pi (not newly allocated pe) should be compared

Fixes: e888a2e8337c ("net/smc: introduce list of pnetids for Ethernet devices")
Signed-off-by: Li RongQing <redacted>
---
  net/smc/smc_pnet.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
index 1dd3623..a04aa0e 100644
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -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;
Good catch, thanks!

Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help