mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Jesper Juhl <jj@chaosbits.net>
Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Andy Grover <agrover@redhat.com>,
	Dan Carpenter <error27@gmail.com>,
	Roland Dreier <roland@kernel.org>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] target, iscsi: Fix up a few assignments
Date: Mon, 16 Jan 2012 18:30:01 -0800	[thread overview]
Message-ID: <1326767401.3600.41.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1201151929400.13069@swampdragon.chaosbits.net>

On Sun, 2012-01-15 at 19:33 +0100, Jesper Juhl wrote:
> A statement such as
>   struct iscsi_node_attrib *na = na = iscsit_tpg_get_node_attrib(sess);
> has undefined behaviour since there are two assignments to 'na', strictly 
> speaking (the order in which side-effects from the assignments take place 
> is undefined since there's no intervening sequence point), and it looks 
> unintentional in any case.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
>  drivers/target/iscsi/iscsi_target_erl1.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
>  compile tested only.
> 
> diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
> index 101b1be..af18cb8 100644
> --- a/drivers/target/iscsi/iscsi_target_erl1.c
> +++ b/drivers/target/iscsi/iscsi_target_erl1.c
> @@ -1238,7 +1238,7 @@ void iscsit_mod_dataout_timer(struct iscsi_cmd *cmd)
>  {
>  	struct iscsi_conn *conn = cmd->conn;
>  	struct iscsi_session *sess = conn->sess;
> -	struct iscsi_node_attrib *na = na = iscsit_tpg_get_node_attrib(sess);
> +	struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);
>  
>  	spin_lock_bh(&cmd->dataout_timeout_lock);
>  	if (!(cmd->dataout_timer_flags & ISCSI_TF_RUNNING)) {
> @@ -1261,7 +1261,7 @@ void iscsit_start_dataout_timer(
>  	struct iscsi_conn *conn)
>  {
>  	struct iscsi_session *sess = conn->sess;
> -	struct iscsi_node_attrib *na = na = iscsit_tpg_get_node_attrib(sess);
> +	struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);
>  
>  	if (cmd->dataout_timer_flags & ISCSI_TF_RUNNING)
>  		return;
> -- 

Copy and paste error.  :(

Applied to lio-core, and thanks for catching this Jesper!



      reply	other threads:[~2012-01-17  2:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 18:33 Jesper Juhl
2012-01-17  2:30 ` Nicholas A. Bellinger [this message]

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=1326767401.3600.41.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=agrover@redhat.com \
    --cc=error27@gmail.com \
    --cc=hch@lst.de \
    --cc=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=roland@kernel.org \
    --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

all inboxes | Powered by JetHome®