lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <afbff5b7-1004-a445-9005-7391c91a275d@gmail.com>
Date:   Fri, 19 Aug 2022 22:12:34 +0900
From:   Taehee Yoo <ap420073@...il.com>
To:     Yang Yingliang <yangyingliang@...wei.com>,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Cc:     davem@...emloft.net
Subject: Re: [PATCH -next] amt: remove unneccessary skb pointer check

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@...wei.com>

Reviewed-by: Taehee Yoo <ap420073@...il.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;
>   	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ