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] [day] [month] [year] [list]
Message-ID: <1647636f-007e-2912-c2d9-7fed172ca352@kernel.dk>
Date:   Thu, 2 Jun 2022 01:47:38 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     cgel.zte@...il.com
Cc:     asml.silence@...il.com, io-uring@...r.kernel.org,
        linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] io_uring: Remove redundant NULL check before kfree

On 6/2/22 1:18 AM, cgel.zte@...il.com wrote:
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 1fc0166d9133..d1fe967f2343 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -4445,8 +4445,7 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
>  	kiocb_done(req, ret, issue_flags);
>  out_free:
>  	/* it's faster to check here then delegate to kfree */
> -	if (iovec)
> -		kfree(iovec);
> +	kfree(iovec);
>  	return 0;
>  }

There is _literally_ a comment right above your change that explains why
this is there. Please read surrounding code, at least.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ