From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751725AbdCNQmc (ORCPT ); Tue, 14 Mar 2017 12:42:32 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35590 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbdCNQma (ORCPT ); Tue, 14 Mar 2017 12:42:30 -0400 Date: Tue, 14 Mar 2017 09:42:21 -0700 From: Stephen Hemminger To: Cathy Avery 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. Message-ID: <20170314094221.336a1be2@xeon-e3> In-Reply-To: <1489507263-21365-1-git-send-email-cavery@redhat.com> References: <1489507263-21365-1-git-send-email-cavery@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Mar 2017 12:01:03 -0400 Cathy Avery 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, };