Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600723

Re: [PATCH] scsi: storvsc: Add support for FC rport.

From Cathy Avery <cavery@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] scsi: storvsc: Add support for FC rport.
Date 2017-03-14 18:20 +0100
Message-ID <tkYh4-3lW-9@gated-at.bofh.it> (permalink)
References <tkXbj-2zg-17@gated-at.bofh.it> <tkXO2-2Py-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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,
> 		};

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] scsi: storvsc: Add support for FC rport. Cathy Avery <cavery@redhat.com> - 2017-03-14 17:10 +0100
  Re: [PATCH] scsi: storvsc: Add support for FC rport. Stephen Hemminger <stephen@networkplumber.org> - 2017-03-14 17:50 +0100
    Re: [PATCH] scsi: storvsc: Add support for FC rport. Cathy Avery <cavery@redhat.com> - 2017-03-14 18:20 +0100

csiph-web