From: Mike Christie <mchristi@redhat.com>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH] target:fix destory device in target_configure_device
Date: Mon, 15 Jan 2018 20:43:59 +0000 [thread overview]
Message-ID: <5A5D128F.9050703@redhat.com> (raw)
In-Reply-To: <1516018177-7714-1-git-send-email-tang.wenji@zte.com.cn>
On 01/15/2018 06:09 AM, tang.wenji@zte.com.cn wrote:
> From: tangwenji <tang.wenji@zte.com.cn>
>
> After dev->transport->configure_device succeeds,target_configure_device
> exits abnormally, dev_flags has not set DF_CONFIGURED yet, does not call
> destory_device function in free_device
>
> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> ---
> drivers/target/target_core_device.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
> index e8dd6da..18716fa 100644
> --- a/drivers/target/target_core_device.c
> +++ b/drivers/target/target_core_device.c
> @@ -997,7 +997,7 @@ int target_configure_device(struct se_device *dev)
>
> ret = core_setup_alua(dev);
> if (ret)
> - goto out_free_index;
> + goto out_destory_device;
>
> /*
> * Startup the struct se_device processing thread
> @@ -1041,6 +1041,8 @@ int target_configure_device(struct se_device *dev)
>
> out_free_alua:
> core_alua_free_lu_gp_mem(dev);
> +out_destory_device:
> + dev->transport->destroy_device(dev);
> out_free_index:
> mutex_lock(&device_mutex);
> idr_remove(&devices_idr, dev->dev_index);
>
Looks ok to me.
Reviewed-by: Mike Christie <mchristi@redhat.com>
next prev parent reply other threads:[~2018-01-15 20:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-15 12:09 [PATCH] target:fix destory device in target_configure_device tang.wenji
2018-01-15 20:43 ` Mike Christie [this message]
2018-01-16 16:04 ` Bart Van Assche
2018-01-18 9:22 ` Nicholas A. Bellinger
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=5A5D128F.9050703@redhat.com \
--to=mchristi@redhat.com \
--cc=target-devel@vger.kernel.org \
/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.