All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Ocean He <oceanhehy@gmail.com>,
	dan.j.williams@intel.com, ross.zwisler@linux.intel.com,
	vishal.l.verma@intel.com
Cc: Ocean He <hehy1@lenovo.com>,
	linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org
Subject: Re: [PATCH] libnvdimm, bus: check id immediately following ida_simple_get
Date: Tue, 7 Aug 2018 15:46:09 -0700	[thread overview]
Message-ID: <6c505c3e-1c2d-a74b-1018-f8abe5175f13@intel.com> (raw)
In-Reply-To: <1533298113-17495-1-git-send-email-oceanhehy@gmail.com>



On 08/03/2018 05:08 AM, 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>

Applied.

> ---
>  drivers/nvdimm/bus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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;
> 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: Dave Jiang <dave.jiang@intel.com>
To: Ocean He <oceanhehy@gmail.com>,
	dan.j.williams@intel.com, ross.zwisler@linux.intel.com,
	vishal.l.verma@intel.com
Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org,
	Ocean He <hehy1@lenovo.com>
Subject: Re: [PATCH] libnvdimm, bus: check id immediately following ida_simple_get
Date: Tue, 7 Aug 2018 15:46:09 -0700	[thread overview]
Message-ID: <6c505c3e-1c2d-a74b-1018-f8abe5175f13@intel.com> (raw)
In-Reply-To: <1533298113-17495-1-git-send-email-oceanhehy@gmail.com>



On 08/03/2018 05:08 AM, 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>

Applied.

> ---
>  drivers/nvdimm/bus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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;
> 

  parent reply	other threads:[~2018-08-07 22:46 UTC|newest]

Thread overview: 6+ 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 12:08 ` Ocean He
2018-08-03 17:13 ` Verma, Vishal L
2018-08-03 17:13   ` Verma, Vishal L
2018-08-07 22:46 ` Dave Jiang [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=6c505c3e-1c2d-a74b-1018-f8abe5175f13@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dan.j.williams@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 \
    --cc=vishal.l.verma@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 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.