diff mbox series

[net] ipv4: igmp: Remove redundant comparison in igmp_mcf_get_next()

Message ID 20230828085926.424703-1-Ilia.Gavrilov@infotecs.ru (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [net] ipv4: igmp: Remove redundant comparison in igmp_mcf_get_next() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1335 this patch: 1335
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1358 this patch: 1358
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Gavrilov Ilia Aug. 28, 2023, 9:01 a.m. UTC
The 'state->im' value will always be non-zero after
the 'while' statement, so the check can be removed.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
---
 net/ipv4/igmp.c | 2 --
 1 file changed, 2 deletions(-)

Comments

David Ahern Aug. 29, 2023, 2:45 a.m. UTC | #1
On 8/28/23 3:01 AM, Gavrilov Ilia wrote:
> The 'state->im' value will always be non-zero after
> the 'while' statement, so the check can be removed.
> 
> Found by InfoTeCS on behalf of Linux Verification Center
> (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
> ---
>  net/ipv4/igmp.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> index 48ff5f13e797..6ebf06886527 100644
> --- a/net/ipv4/igmp.c
> +++ b/net/ipv4/igmp.c
> @@ -2943,8 +2943,6 @@ static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_l
>  				continue;
>  			state->im = rcu_dereference(state->idev->mc_list);
>  		}
> -		if (!state->im)
> -			break;
>  		spin_lock_bh(&state->im->lock);
>  		psf = state->im->sources;
>  	}

Same with this one: agree the check is not needed, but I also believe it
does not need to be backported. Since net-next is closed, resubmit after
9/11.

--
pw-bot: defer
Gavrilov Ilia Aug. 29, 2023, 6:55 a.m. UTC | #2
On 8/29/23 05:45, David Ahern wrote:
> On 8/28/23 3:01 AM, Gavrilov Ilia wrote:
>> The 'state->im' value will always be non-zero after
>> the 'while' statement, so the check can be removed.
>>
>> Found by InfoTeCS on behalf of Linux Verification Center
>> (linuxtesting.org) with SVACE.
>>
>> Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
>> ---
>>   net/ipv4/igmp.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
>> index 48ff5f13e797..6ebf06886527 100644
>> --- a/net/ipv4/igmp.c
>> +++ b/net/ipv4/igmp.c
>> @@ -2943,8 +2943,6 @@ static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_l
>>   				continue;
>>   			state->im = rcu_dereference(state->idev->mc_list);
>>   		}
>> -		if (!state->im)
>> -			break;
>>   		spin_lock_bh(&state->im->lock);
>>   		psf = state->im->sources;
>>   	}
> 
> Same with this one: agree the check is not needed, but I also believe it
> does not need to be backported. Since net-next is closed, resubmit after
> 9/11.
> 
> --
> pw-bot: defer

I'll resend it after 9/11.
Thank you for the review!
diff mbox series

Patch

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 48ff5f13e797..6ebf06886527 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2943,8 +2943,6 @@  static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_l
 				continue;
 			state->im = rcu_dereference(state->idev->mc_list);
 		}
-		if (!state->im)
-			break;
 		spin_lock_bh(&state->im->lock);
 		psf = state->im->sources;
 	}