mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH -next] amt: remove unneccessary skb pointer check
Date: Fri, 19 Aug 2022 22:12:34 +0900	[thread overview]
Message-ID: <afbff5b7-1004-a445-9005-7391c91a275d@gmail.com> (raw)
In-Reply-To: <20220818093114.2449179-1-yangyingliang@huawei.com>

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;
>   	}

  reply	other threads:[~2022-08-19 13:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18  9:31 Yang Yingliang
2022-08-19 13:12 ` Taehee Yoo [this message]
2022-08-20  0:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afbff5b7-1004-a445-9005-7391c91a275d@gmail.com \
    --to=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®