diff mbox series

[-next] amt: remove unneccessary skb pointer check

Message ID 20220818093114.2449179-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 6745bc9b0351525e80cc7578e8ce22f83cfa3a84
Delegated to: Netdev Maintainers
Headers show
Series [-next] amt: remove unneccessary skb pointer check | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 87 this patch: 87
netdev/cc_maintainers warning 3 maintainers not CCed: edumazet@google.com pabeni@redhat.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 87 this patch: 87
netdev/checkpatch warning WARNING: 'unneccessary' may be misspelled - perhaps 'unnecessary'?
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Aug. 18, 2022, 9:31 a.m. UTC
The skb pointer will be checked in kfree_skb(), so remove the outside check.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/amt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Taehee Yoo Aug. 19, 2022, 1:12 p.m. UTC | #1
Hi Yang,
Thanks for this work!

On 8/18/22 18:31, Yang Yingliang wrote:
> The skb pointer will be checked in kfree_skb(), so remove the outside check.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Taehee Yoo <ap420073@gmail.com>

> ---
>   drivers/net/amt.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 9a247eb7679c..2d20be6ffb7e 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
> @@ -2894,8 +2894,7 @@ static void amt_event_work(struct work_struct *work)
>   			amt_event_send_request(amt);
>   			break;
>   		default:
> -			if (skb)
> -				kfree_skb(skb);
> +			kfree_skb(skb);
>   			break;
>   		}
>   	}
> @@ -3033,8 +3032,7 @@ static int amt_dev_stop(struct net_device *dev)
>   	cancel_work_sync(&amt->event_wq);
>   	for (i = 0; i < AMT_MAX_EVENTS; i++) {
>   		skb = amt->events[i].skb;
> -		if (skb)
> -			kfree_skb(skb);
> +		kfree_skb(skb);
>   		amt->events[i].event = AMT_EVENT_NONE;
>   		amt->events[i].skb = NULL;
>   	}
patchwork-bot+netdevbpf@kernel.org Aug. 20, 2022, midnight UTC | #2
Hello:

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

On Thu, 18 Aug 2022 17:31:14 +0800 you wrote:
> The skb pointer will be checked in kfree_skb(), so remove the outside check.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/amt.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [-next] amt: remove unneccessary skb pointer check
    https://git.kernel.org/netdev/net-next/c/6745bc9b0351

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 9a247eb7679c..2d20be6ffb7e 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2894,8 +2894,7 @@  static void amt_event_work(struct work_struct *work)
 			amt_event_send_request(amt);
 			break;
 		default:
-			if (skb)
-				kfree_skb(skb);
+			kfree_skb(skb);
 			break;
 		}
 	}
@@ -3033,8 +3032,7 @@  static int amt_dev_stop(struct net_device *dev)
 	cancel_work_sync(&amt->event_wq);
 	for (i = 0; i < AMT_MAX_EVENTS; i++) {
 		skb = amt->events[i].skb;
-		if (skb)
-			kfree_skb(skb);
+		kfree_skb(skb);
 		amt->events[i].event = AMT_EVENT_NONE;
 		amt->events[i].skb = NULL;
 	}