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: <1440092994.30197.5.camel@linux.intel.com>
Date:	Thu, 20 Aug 2015 11:49:54 -0600
From:	Ross Zwisler <ross.zwisler@...ux.intel.com>
To:	yalin wang <yalin.wang2010@...il.com>
Cc:	dan.j.williams@...el.com, linux-nvdimm@...ts.01.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvdimm: change to use generic kvfree()

On Thu, 2015-08-20 at 18:00 +0800, yalin wang wrote:
> Signed-off-by: yalin wang <yalin.wang2010@...il.com>
> ---
>  drivers/nvdimm/dimm_devs.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
> index c05eb80..651b8d1 100644
> --- a/drivers/nvdimm/dimm_devs.c
> +++ b/drivers/nvdimm/dimm_devs.c
> @@ -241,10 +241,7 @@ void nvdimm_drvdata_release(struct kref *kref)
>  		nvdimm_free_dpa(ndd, res);
>  	nvdimm_bus_unlock(dev);
>  
> -	if (ndd->data && is_vmalloc_addr(ndd->data))
> -		vfree(ndd->data);
> -	else
> -		kfree(ndd->data);
> +	kvfree(ndd->data);
>  	kfree(ndd);
>  	put_device(dev);
>  }

This seems fine.  You're skipping the existing check to see if ndd->data is
NULL, but I think that is handled implicitly by is_vmalloc_addr() since NULL
won't be in the vmalloc address range.

Reviewed-by: Ross Zwisler <ross.zwisler@...ux.intel.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ