Message ID | 20241014115321.33234-1-lirongqing@baidu.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 82ac39ebd6db0c9f7a97a934bda1e3e101a9d201 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2] net/smc: Fix searching in list of known pnetids in smc_pnet_add_pnetid | expand |
On Mon, Oct 14, 2024 at 07:53:21PM +0800, Li RongQing wrote: > pnetid of pi (not newly allocated pe) should be compared > > Fixes: e888a2e8337c ("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>
On Mon, 2024-10-14 at 19:53 +0800, Li RongQing wrote: > pnetid of pi (not newly allocated pe) should be compared > > Fixes: e888a2e8337c ("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> > --- > Diff with v1: change commit header as Gerd Bayer suggested > Sorry for not CC all maintainers, since this patch was rejected by > netdev twice > > 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; Thanks for adapting the subject! Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Mon, 14 Oct 2024 19:53:21 +0800 you wrote: > pnetid of pi (not newly allocated pe) should be compared > > Fixes: e888a2e8337c ("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> > > [...] Here is the summary with links: - [v2] net/smc: Fix searching in list of known pnetids in smc_pnet_add_pnetid https://git.kernel.org/netdev/net/c/82ac39ebd6db You are awesome, thank you!
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;