public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: sit: remove redundant ret = 0 assignment
@ 2026-04-03  8:44 Yue Haibing
  2026-04-06 14:35 ` Simon Horman
  2026-04-07  1:43 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Yue Haibing @ 2026-04-03  8:44 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, yuehaibing
  Cc: netdev, linux-kernel

The variable ret is initialized to 0 when it is defined
and is not modified before copy_to_user().

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

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index ef2e5111fb3a..09c0a01d44f4 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -359,7 +359,6 @@ static int ipip6_tunnel_get_prl(struct net_device *dev, struct ip_tunnel_prl __u
 	rcu_read_unlock();
 
 	len = sizeof(*kp) * c;
-	ret = 0;
 	if ((len && copy_to_user(a + 1, kp, len)) || put_user(len, &a->datalen))
 		ret = -EFAULT;
 
-- 
2.34.1


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

* Re: [PATCH net-next] ipv6: sit: remove redundant ret = 0 assignment
  2026-04-03  8:44 [PATCH net-next] ipv6: sit: remove redundant ret = 0 assignment Yue Haibing
@ 2026-04-06 14:35 ` Simon Horman
  2026-04-07  1:43 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-04-06 14:35 UTC (permalink / raw)
  To: Yue Haibing; +Cc: davem, dsahern, edumazet, kuba, pabeni, netdev, linux-kernel

On Fri, Apr 03, 2026 at 04:44:02PM +0800, Yue Haibing wrote:
> The variable ret is initialized to 0 when it is defined
> and is not modified before copy_to_user().
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>

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


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

* Re: [PATCH net-next] ipv6: sit: remove redundant ret = 0 assignment
  2026-04-03  8:44 [PATCH net-next] ipv6: sit: remove redundant ret = 0 assignment Yue Haibing
  2026-04-06 14:35 ` Simon Horman
@ 2026-04-07  1:43 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-04-07  1:43 UTC (permalink / raw)
  To: Yue Haibing; +Cc: davem, dsahern, edumazet, pabeni, horms, netdev, linux-kernel

On Fri, 3 Apr 2026 16:44:02 +0800 Yue Haibing wrote:
> The variable ret is initialized to 0 when it is defined
> and is not modified before copy_to_user().

Makes more sense to remove the init during definition IMO.

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

end of thread, other threads:[~2026-04-07  1:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03  8:44 [PATCH net-next] ipv6: sit: remove redundant ret = 0 assignment Yue Haibing
2026-04-06 14:35 ` Simon Horman
2026-04-07  1:43 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox