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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux