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


Groups > linux.kernel > #1600690

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

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Stephen Hemminger <stephen@networkplumber.org>
Newsgroups linux.kernel
Subject Re: [PATCH] scsi: storvsc: Add support for FC rport.
Date Tue, 14 Mar 2017 17:50:02 +0100
Message-ID <tkXO2-2Py-19@gated-at.bofh.it> (permalink)
References <tkXbj-2zg-17@gated-at.bofh.it>
X-Original-To Cathy Avery <cavery@redhat.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KkdIq3eEzRWRdlRAkG0WRJvWV8nT9sW89nJXXt4n8RA=; b=J+pt7y+9m5ubs5F9J1zeyQsZn3HlBBHQmI9UqbdgGiBjH8NZP2Dvffaww0CT9EIA4l IeV+sraA6KkN4NrRbvMs1j4rOf1lQQnWrEAn1h88SbeV8cUlzL9takPtyMeF6KvissDQ JUfmxcbc0RkV+otCg2+DzlnkJcfX9BrYj8J6558E7RVo8+ky3PoRqyyLhIpy2PLzI9+l Smw6K7j3zdtzPkf4e/m2F276j1sWLMvMDrcOuIWx8ArRXmEMHa9Xh779CEZPDuFlZmWp whp6lMUHjedDbTHq33+1c3Bwe1FE/hKKIOKJJ7UcSX0XNp/rtJJZ15lop3576+/F4T+x 467w==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KkdIq3eEzRWRdlRAkG0WRJvWV8nT9sW89nJXXt4n8RA=; b=iM3mBdHZPMkTffD03sHyEiVTcJvvYlV1zC3cpAR88K7stsC6iZuPrqfmOPuwOnWsOX SbsP+NVsj7IFT8rTFtBT4/YqzdJePicYb+RcLkbthWj8L/4hO++BdsbT7AtQy9EXG/1b paBoAcfUnxIr2RSwJOLqVSKA+IYB8yVW8u3LaQjlLM+kzPsdeLD1G/DjOuMxn4zAaPyx bU7qVL2V9LtLdkI0LmqdCLD1KT9PY7uUPkqcRzBFkJKBE/OZrF9t6PKFF9yIAmTY960I T7b+frsS9eU4h8wUiTNcpDQ69+r5/cU2IbCDlOZh0vwySh8t03ckDuN+XSOkdzaa/nx2 MTTA==
X-Gm-Message-State AMke39l+7/Pfn7vd3PbqFI7j4WQFFLyczQ7aldfymvm37VIeJc/E6srU1ntyRSGmdweiLw==
X-Received by 10.99.47.68 with SMTP id v65mr44776727pgv.23.1489509748880; Tue, 14 Mar 2017 09:42:28 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 20
Organization linux.* mail to news gateway
X-Original-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
X-Original-Date Tue, 14 Mar 2017 09:42:21 -0700
X-Original-Message-ID <20170314094221.336a1be2@xeon-e3>
X-Original-References <1489507263-21365-1-git-send-email-cavery@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1600690

Show key headers only | View raw


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 | Next 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