From: Stephen Hemminger <stephen@networkplumber.org>
To: Cathy Avery <cavery@redhat.com>
Cc: kys@microsoft.com, hch@infradead.org, haiyangz@microsoft.com,
jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
dan.carpenter@oracle.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: storvsc: Add support for FC rport.
Date: Tue, 14 Mar 2017 09:42:21 -0700 [thread overview]
Message-ID: <20170314094221.336a1be2@xeon-e3> (raw)
In-Reply-To: <1489507263-21365-1-git-send-email-cavery@redhat.com>
On Tue, 14 Mar 2017 12:01:03 -0400
Cathy Avery <cavery@redhat.com> wrote:
> #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
> if (host->transportt == fc_transport_template) {
> + struct fc_rport_identifiers ids;
> +
> + ids.node_name = 0;
> + ids.port_name = 0;
> + ids.port_id = 0;
> + ids.roles |= FC_PORT_ROLE_FCP_TARGET;
Since the variable ids is on the stack, it is uninitialized data.
Doing a OR with uninitialized data is not correct.
Better off to use C99 style iniatializer and skip the zero fields.
struct fc_rport_identifiers ids = {
.roles = FC_PORT_ROLE_FCP_TARGET,
};
next prev parent reply other threads:[~2017-03-14 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 16:01 [PATCH] scsi: storvsc: Add support for FC rport Cathy Avery
2017-03-14 16:42 ` Stephen Hemminger [this message]
2017-03-14 17:10 ` Cathy Avery
-- strict thread matches above, loose matches on Subject: below --
2017-02-28 18:45 Cathy Avery
2017-03-13 14:51 ` Cathy Avery
2017-03-14 2:36 ` 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=20170314094221.336a1be2@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=cavery@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=hch@infradead.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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