Re: [PATCH] blkcg: check pol->cpd_free_fn before free cpd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 10, 2017 at 09:04:39AM -0600, Jens Axboe wrote:
> On 10/10/2017 08:53 AM, weiping zhang wrote:
> > check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd.
> 
> In practice this shouldn't make a difference, since if you have an
> alloc_fn, you better also have a free_fn. I'd argue a better
> patch would be ensuring that's the case, since the current situation
> would at least oops and show you there's an issue, but with the patch
> we'll just leak the memory.
> 
> I'll apply it, but would be nice if this was handled a bit more
> proactively.
> 
Thanks your comments, I'll add a sanity check in blkcg_policy_register
function.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux