From: Mike Christie <mchristi@redhat.com>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH] target:iscsi:free conn_ops when zalloc_cpumask_var failed
Date: Wed, 20 Mar 2019 16:35:55 +0000 [thread overview]
Message-ID: <5C926BEB.5020909@redhat.com> (raw)
In-Reply-To: <1553091284-4412-1-git-send-email-hndksztwj@163.com>
On 03/20/2019 09:14 AM, tangwenji wrote:
> From: tangwenji <tang.wenji@zte.com.cn>
>
> It should not free cpumask but free conn->conn_ops When zalloc_cpumask_var failed.
>
> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> ---
> drivers/target/iscsi/iscsi_target_login.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
> index ae3209e..c3e1d40 100644
> --- a/drivers/target/iscsi/iscsi_target_login.c
> +++ b/drivers/target/iscsi/iscsi_target_login.c
> @@ -1159,13 +1159,13 @@ static struct iscsi_conn *iscsit_alloc_conn(struct iscsi_np *np)
>
> if (!zalloc_cpumask_var(&conn->conn_cpumask, GFP_KERNEL)) {
> pr_err("Unable to allocate conn->conn_cpumask\n");
> - goto free_mask;
> + goto free_conn_ops;
> }
>
> return conn;
>
> -free_mask:
> - free_cpumask_var(conn->conn_cpumask);
> +free_conn_ops:
> + kfree(conn->conn_ops);
> put_transport:
> iscsit_put_transport(conn->conn_transport);
> free_conn:
>
Reviewed-by: Mike Christie <mchristi@redhat.com>
next prev parent reply other threads:[~2019-03-20 16:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 14:14 [PATCH] target:iscsi:free conn_ops when zalloc_cpumask_var failed tangwenji
2019-03-20 16:35 ` Mike Christie [this message]
2019-03-21 0:38 ` Martin K. Petersen
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=5C926BEB.5020909@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox