linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev()
@ 2025-07-14  8:17 Yue Haibing
  2025-07-14 12:29 ` Simon Horman
  2025-07-15 23:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Yue Haibing @ 2025-07-14  8:17 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms
  Cc: netdev, linux-kernel, yuehaibing

These is no need to check null for idev before return NULL.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 net/ipv6/mcast.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index e95273ffb2f5..8aecdd85a6ae 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -329,9 +329,6 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net,
 	idev = in6_dev_get(dev);
 	dev_put(dev);
 
-	if (!idev)
-		return NULL;
-
 	return idev;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev()
  2025-07-14  8:17 [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev() Yue Haibing
@ 2025-07-14 12:29 ` Simon Horman
  2025-07-14 16:39   ` Kuniyuki Iwashima
  2025-07-15 23:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Horman @ 2025-07-14 12:29 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, dsahern, edumazet, kuba, pabeni, netdev, linux-kernel,
	Kuniyuki Iwashima

+ Iwashima-san

On Mon, Jul 14, 2025 at 04:17:32PM +0800, Yue Haibing wrote:
> These is no need to check null for idev before return NULL.
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
>  net/ipv6/mcast.c | 3 ---
>  1 file changed, 3 deletions(-)

This appears to be a side effect of
commit e6e14d582dd2 ("ipv6: mcast: Don't hold RTNL for MCAST_ socket options.")

I've CCed Iwashimsa-san, who wrote that patch.

But in any case this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> index e95273ffb2f5..8aecdd85a6ae 100644
> --- a/net/ipv6/mcast.c
> +++ b/net/ipv6/mcast.c
> @@ -329,9 +329,6 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net,
>  	idev = in6_dev_get(dev);
>  	dev_put(dev);
>  
> -	if (!idev)
> -		return NULL;
> -
>  	return idev;
>  }
>  
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev()
  2025-07-14 12:29 ` Simon Horman
@ 2025-07-14 16:39   ` Kuniyuki Iwashima
  0 siblings, 0 replies; 4+ messages in thread
From: Kuniyuki Iwashima @ 2025-07-14 16:39 UTC (permalink / raw)
  To: Simon Horman
  Cc: Yue Haibing, davem, dsahern, edumazet, kuba, pabeni, netdev,
	linux-kernel

On Mon, Jul 14, 2025 at 5:29 AM Simon Horman <horms@kernel.org> wrote:
>
> + Iwashima-san
>
> On Mon, Jul 14, 2025 at 04:17:32PM +0800, Yue Haibing wrote:
> > These is no need to check null for idev before return NULL.
> >
> > Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> > ---
> >  net/ipv6/mcast.c | 3 ---
> >  1 file changed, 3 deletions(-)
>
> This appears to be a side effect of
> commit e6e14d582dd2 ("ipv6: mcast: Don't hold RTNL for MCAST_ socket options.")

Exactly :)

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

Thank you!

>
> I've CCed Iwashimsa-san, who wrote that patch.
>
> But in any case this looks good to me.
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
> > diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> > index e95273ffb2f5..8aecdd85a6ae 100644
> > --- a/net/ipv6/mcast.c
> > +++ b/net/ipv6/mcast.c
> > @@ -329,9 +329,6 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net,
> >       idev = in6_dev_get(dev);
> >       dev_put(dev);
> >
> > -     if (!idev)
> > -             return NULL;
> > -
> >       return idev;
> >  }
> >
> > --
> > 2.34.1
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev()
  2025-07-14  8:17 [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev() Yue Haibing
  2025-07-14 12:29 ` Simon Horman
@ 2025-07-15 23:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-15 23:40 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, dsahern, edumazet, kuba, pabeni, horms, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 14 Jul 2025 16:17:32 +0800 you wrote:
> These is no need to check null for idev before return NULL.
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
>  net/ipv6/mcast.c | 3 ---
>  1 file changed, 3 deletions(-)

Here is the summary with links:
  - [net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev()
    https://git.kernel.org/netdev/net-next/c/ce6030afe459

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-15 23:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14  8:17 [PATCH net-next] ipv6: mcast: Remove unnecessary null check in ip6_mc_find_dev() Yue Haibing
2025-07-14 12:29 ` Simon Horman
2025-07-14 16:39   ` Kuniyuki Iwashima
2025-07-15 23:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).