From: Cathy Avery <cavery@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
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 13:10:38 -0400 [thread overview]
Message-ID: <58C8240E.9030907@redhat.com> (raw)
In-Reply-To: <20170314094221.336a1be2@xeon-e3>
Good catch. Thanks!
On 03/14/2017 12:42 PM, Stephen Hemminger wrote:
> 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,
> };
WARNING: multiple messages have this Message-ID (diff)
From: Cathy Avery <cavery@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com, haiyangz@microsoft.com,
linux-kernel@vger.kernel.org, hch@infradead.org,
devel@linuxdriverproject.org, dan.carpenter@oracle.com
Subject: Re: [PATCH] scsi: storvsc: Add support for FC rport.
Date: Tue, 14 Mar 2017 13:10:38 -0400 [thread overview]
Message-ID: <58C8240E.9030907@redhat.com> (raw)
In-Reply-To: <20170314094221.336a1be2@xeon-e3>
Good catch. Thanks!
On 03/14/2017 12:42 PM, Stephen Hemminger wrote:
> 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 17:10 UTC|newest]
Thread overview: 11+ 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:01 ` Cathy Avery
2017-03-14 16:42 ` Stephen Hemminger
2017-03-14 16:42 ` Stephen Hemminger
2017-03-14 17:10 ` Cathy Avery [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-02-28 18:45 ` Cathy Avery
2017-03-13 14:51 ` Cathy Avery
2017-03-14 2:36 ` Martin K. Petersen
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=58C8240E.9030907@redhat.com \
--to=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 \
--cc=stephen@networkplumber.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.