From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: yalin wang <yalin.wang2010@gmail.com>
Cc: dan.j.williams@intel.com, linux-nvdimm@lists.01.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvdimm: change to use generic kvfree()
Date: Thu, 20 Aug 2015 11:49:54 -0600 [thread overview]
Message-ID: <1440092994.30197.5.camel@linux.intel.com> (raw)
In-Reply-To: <1440064809-26036-1-git-send-email-yalin.wang2010@gmail.com>
On Thu, 2015-08-20 at 18:00 +0800, yalin wang wrote:
> Signed-off-by: yalin wang <yalin.wang2010@gmail.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@linux.intel.com>
WARNING: multiple messages have this Message-ID (diff)
From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: yalin wang <yalin.wang2010@gmail.com>
Cc: dan.j.williams@intel.com, linux-nvdimm@ml01.01.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvdimm: change to use generic kvfree()
Date: Thu, 20 Aug 2015 11:49:54 -0600 [thread overview]
Message-ID: <1440092994.30197.5.camel@linux.intel.com> (raw)
In-Reply-To: <1440064809-26036-1-git-send-email-yalin.wang2010@gmail.com>
On Thu, 2015-08-20 at 18:00 +0800, yalin wang wrote:
> Signed-off-by: yalin wang <yalin.wang2010@gmail.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@linux.intel.com>
next prev parent reply other threads:[~2015-08-20 17:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 10:00 [PATCH] nvdimm: change to use generic kvfree() yalin wang
2015-08-20 10:00 ` yalin wang
2015-08-20 17:49 ` Ross Zwisler [this message]
2015-08-20 17:49 ` Ross Zwisler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1440092994.30197.5.camel@linux.intel.com \
--to=ross.zwisler@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=yalin.wang2010@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.