mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ipv6: mcast: Avoid a duplicate pointer check in mld_del_delrec()
Avoid duplicate non-null pointer check for pmc in mld_del_delrec(). No functional changes. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20250714081949.3109947-1-yuehaibing@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
06baf9bfa6
commit
a8594c956c
1 changed files with 23 additions and 25 deletions
|
@ -789,14 +789,13 @@ static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
|
|||
break;
|
||||
pmc_prev = pmc;
|
||||
}
|
||||
if (pmc) {
|
||||
if (!pmc)
|
||||
return;
|
||||
if (pmc_prev)
|
||||
rcu_assign_pointer(pmc_prev->next, pmc->next);
|
||||
else
|
||||
rcu_assign_pointer(idev->mc_tomb, pmc->next);
|
||||
}
|
||||
|
||||
if (pmc) {
|
||||
im->idev = pmc->idev;
|
||||
if (im->mca_sfmode == MCAST_INCLUDE) {
|
||||
tomb = rcu_replace_pointer(im->mca_tomb,
|
||||
|
@ -817,7 +816,6 @@ static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
|
|||
ip6_mc_clear_src(pmc);
|
||||
kfree_rcu(pmc, rcu);
|
||||
}
|
||||
}
|
||||
|
||||
static void mld_clear_delrec(struct inet6_dev *idev)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue