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: <20190430162626.GC8314@lakrids.cambridge.arm.com>
Date:   Tue, 30 Apr 2019 17:26:26 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     linux-kernel@...r.kernel.org,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.or
Subject: Re: [PATCH] io_uring: free allocated io_memory once

On Tue, Apr 30, 2019 at 10:22:23AM -0600, Jens Axboe wrote:
> On 4/30/19 10:20 AM, Mark Rutland wrote:
> > -	io_mem_free(ctx->sq_ring);
> > -	io_mem_free(ctx->sq_sqes);
> > -	io_mem_free(ctx->cq_ring);
> > +	if (ctx->sq_ring)
> > +		io_mem_free(ctx->sq_ring);
> > +	if (ctx->sq_sqes)
> > +		io_mem_free(ctx->sq_sqes);
> > +	if (ctx->cq_ring)
> > +		io_mem_free(ctx->cq_ring);
> 
> Please just make io_mem_free() handle a NULL pointer so we don't need
> these checks.

Sure; I'll spin a v2 momentarily.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ