public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>,
	"ross.zwisler@linux.intel.com" <ross.zwisler@linux.intel.com>,
	"oceanhehy@gmail.com" <oceanhehy@gmail.com>,
	"Jiang, Dave" <dave.jiang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"hehy1@lenovo.com" <hehy1@lenovo.com>
Subject: Re: [PATCH] libnvdimm, bus: check id immediately following ida_simple_get
Date: Fri, 3 Aug 2018 17:13:39 +0000	[thread overview]
Message-ID: <1533316417.8557.72.camel@intel.com> (raw)
In-Reply-To: <1533298113-17495-1-git-send-email-oceanhehy@gmail.com>


On Fri, 2018-08-03 at 08:08 -0400, Ocean He wrote:
> From: Ocean He <hehy1@lenovo.com>
> 
> The id check was not executed immediately following ida_simple_get.
> Just
> change the codes position, without function change.
> 
> Signed-off-by: Ocean He <hehy1@lenovo.com>
> ---
>  drivers/nvdimm/bus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Looks good, feel free to add
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

> 
> diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
> index 27902a8..ab28e7c 100644
> --- a/drivers/nvdimm/bus.c
> +++ b/drivers/nvdimm/bus.c
> @@ -350,12 +350,12 @@ struct nvdimm_bus *nvdimm_bus_register(struct
> device *parent,
>  	INIT_LIST_HEAD(&nvdimm_bus->mapping_list);
>  	init_waitqueue_head(&nvdimm_bus->probe_wait);
>  	nvdimm_bus->id = ida_simple_get(&nd_ida, 0, 0, GFP_KERNEL);
> -	mutex_init(&nvdimm_bus->reconfig_mutex);
> -	badrange_init(&nvdimm_bus->badrange);
>  	if (nvdimm_bus->id < 0) {
>  		kfree(nvdimm_bus);
>  		return NULL;
>  	}
> +	mutex_init(&nvdimm_bus->reconfig_mutex);
> +	badrange_init(&nvdimm_bus->badrange);
>  	nvdimm_bus->nd_desc = nd_desc;
>  	nvdimm_bus->dev.parent = parent;
>  	nvdimm_bus->dev.release = nvdimm_bus_release;

  reply	other threads:[~2018-08-03 17:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 12:08 [PATCH] libnvdimm, bus: check id immediately following ida_simple_get Ocean He
2018-08-03 17:13 ` Verma, Vishal L [this message]
2018-08-07 22:46 ` Dave Jiang

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=1533316417.8557.72.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=hehy1@lenovo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=oceanhehy@gmail.com \
    --cc=ross.zwisler@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox