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: <66b69e681ea7a_25752943c@dwillia2-xfh.jf.intel.com.notmuch>
Date: Fri, 9 Aug 2024 15:55:36 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Dan Williams <dan.j.williams@...el.com>, Li Zhijian
	<lizhijian@...itsu.com>, <nvdimm@...ts.linux.dev>
CC: <dan.j.williams@...el.com>, <vishal.l.verma@...el.com>,
	<dave.jiang@...el.com>, <ira.weiny@...el.com>,
	<linux-kernel@...r.kernel.org>, Li Zhijian <lizhijian@...itsu.com>
Subject: Re: [PATCH v2 1/2] nvdimm: Fix devs leaks in scan_labels()

Dan Williams wrote:
[..]
> @@ -2036,12 +2038,10 @@ static struct device **scan_labels(struct nd_region *nd_region)

...of course you would also need something like:

if (!count) {
	kfree(devs);
	return NULL;
}

...here, I'll leave that to you to fix up and test.

>         return devs;
>  
>   err:
> -       if (devs) {
> -               for (i = 0; devs[i]; i++)
> -                       namespace_pmem_release(devs[i]);
> -               kfree(devs);
> -       }
> -       return NULL;
> +        for (i = 0; devs[i]; i++)
> +                namespace_pmem_release(devs[i]);
> +        kfree(devs);
> +        return NULL;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ