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]
Date:   Thu, 14 Dec 2023 15:33:30 +0800 (GMT+08:00)
From:   dinghao.liu@....edu.cn
To:     "Dave Jiang" <dave.jiang@...el.com>
Cc:     "Vishal Verma" <vishal.l.verma@...el.com>,
        "Dan Williams" <dan.j.williams@...el.com>,
        "Ira Weiny" <ira.weiny@...el.com>, nvdimm@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvdimm-btt: simplify code with the scope based resource
 management

> > It's a little strange that we do not check super immediately after allocation.
> > How about this:
> > 
> >  static int discover_arenas(struct btt *btt)
> >  {
> >         int ret = 0;
> >         struct arena_info *arena;
> > -       struct btt_sb *super;
> >         size_t remaining = btt->rawsize;
> >         u64 cur_nlba = 0;
> >         size_t cur_off = 0;
> >         int num_arenas = 0;
> >  
> > -       super = kzalloc(sizeof(*super), GFP_KERNEL);
> > +       struct btt_sb *super __free(kfree) = 
> > +               kzalloc(sizeof(*super), GFP_KERNEL);
> >         if (!super)
> >                 return -ENOMEM;
> >  
> >         while (remaining) {
> >  
> 
> That's fine by me

I will resend a new patch soon, thanks!

Regards,
Dinghao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ