From patchwork Fri Oct 6 11:17:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 115047 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1667538qgn; Fri, 6 Oct 2017 04:18:57 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAL3BwgueP7FvioBJhRLRE0QtOe5U9jbUHVJ9CYelgy65e6xZtU6QE/qwxBeS7Vyh7w1lu+ X-Received: by 10.84.217.201 with SMTP id d9mr1711357plj.0.1507288737835; Fri, 06 Oct 2017 04:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507288737; cv=none; d=google.com; s=arc-20160816; b=bkEIgxvfTnejtbuilObi6CnYYdUH/HxpBtqcXFh806dgt5uq6ykMkgisWA7c0Rsuhd MplRNcUZEQYDaNeom43LRl3crxF/LA+2R5e2CQqABchaa4e1xjs3XnYTHzkypvPfLWHu TyoJdXndCI50ZKBUWE/ZODt2IVT9j8WuXbvMrNfanTFijUj4GENOk4JV0hhqMGXrjZ1w L5pcAz0CISiuhIkFExEUjCXA/rACNZydCXLbVlRbAOTT3Jr7iVE2QRdT4FRUsViKBOaj WBudBloCWIgheB57/UfUh8h2uqkk3eoO5v/6nbrMlsyorRc+dNFUqlIF82YpC31dwq0m yY6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=GAgGjhhJl17itB0G/1MTBv8dZbwds+bripXMMWQnqo4=; b=aD2jtQDhl5QaF668sa6lojF5E9uBMmAJRnq1DrAYIoU5eS2o+Nilzs8FB4bVtHcjdg Y04kZ8WjUTu5RivorMRZ0YYbQisS7Vawwd+Dn9STGVIUFM48J++eBV85ir5zytUZ5eZl c1ozFz6rhqVI2QNnF9GaG2U3uLU22dUf8hH/MuYJcCHiF9BJ0REdT98fJglUhYKD5mIT 3IaICyovkDpz6uPdVE1ZL5AAPx+1wwl+u6DfaRFZTOT1yKBxu5Gd6KiMNOX8ksrk5NOP OLQm5V8R+qZnGwnf9+IwGpoBO8GNdXSpSDQdIROg5F5mlMxudXpuhzTv/3L/udXZ62R6 R7ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=hcVmxs7F; dkim=fail header.i=@verizon.com header.s=corp header.b=d9z2XzW6; dkim=fail header.i=@verizon.com header.s=corp header.b=gtqPf2+t; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si954507pgu.126.2017.10.06.04.18.57; Fri, 06 Oct 2017 04:18:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=hcVmxs7F; dkim=fail header.i=@verizon.com header.s=corp header.b=d9z2XzW6; dkim=fail header.i=@verizon.com header.s=corp header.b=gtqPf2+t; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091AbdJFLSz (ORCPT + 8 others); Fri, 6 Oct 2017 07:18:55 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:2619 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbdJFLSo (ORCPT ); Fri, 6 Oct 2017 07:18:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288724; x=1538824724; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+iJGmuk2Cpy0wdv7SUjArCb+4X4oV4XWplcs1RtA+gc=; b=hcVmxs7FKacJ/HmGe55KeVnVR3XEK1Mp2vhsfmy28qK+NzGnqaEpd6kT YXdAeX11VxjYLCyauGzl0n9RB2qRBw0ZcUmSTypGQYgEBUPTfWG6FKvl5 YQqBUGrRpwsKeMyU0jfght0M9IHXY0JX7ENdBVhiToc0/EjrdEKWCrroW Q=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe02.verizonbusiness.com with ESMTP; 06 Oct 2017 11:18:43 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Arnd Bergmann , "Martin K . Petersen" , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 11:18:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288701; x=1538824701; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+iJGmuk2Cpy0wdv7SUjArCb+4X4oV4XWplcs1RtA+gc=; b=d9z2XzW6q5ljB6Ly5qcg01axUFEc7b7Ltqcu6Zt10l3bgZI1g9b0q7yn t84Fr+lTPaLeaDpqoSw30kMFAdj/dyIvJYzUJpifi+2KZV/OP6JX4Rf1r RgQLG5thd1eCx9rn2oPaDbu6fuLT8YRQAG0+/L3eKE7bkP8qAKYVWfO0a g=; Received: from mariner.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.84]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 07:18:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1507288700; x=1538824700; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+iJGmuk2Cpy0wdv7SUjArCb+4X4oV4XWplcs1RtA+gc=; b=gtqPf2+tsIOs0vPODAG9qwqOxt+kGrXZ0/Wim3lu/xPBadLZx5pbuD8C w66nNMPwDy5YjAXkIKkOwAI9yknGnkMApVtQcCP5Smu6DeY52PnSrzReP FpQNt2JohGdmZylaJW8y4+Me1GMWpORlBU3YhyA9y6LRzcyozdTi20TTB k=; X-Host: mariner.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 06 Oct 2017 11:18:20 +0000 Received: from OHTWI1EXO912.uswin.ad.vzwcorp.com (10.144.218.211) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Oct 2017 07:18:20 -0400 Received: from OMZP1LUMXCA19.uswin.ad.vzwcorp.com (144.8.22.197) by OHTWI1EXO912.uswin.ad.vzwcorp.com (10.144.218.211) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 07:18:20 -0400 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA19.uswin.ad.vzwcorp.com (144.8.22.197) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 6 Oct 2017 06:18:18 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 6 Oct 2017 06:18:18 -0500 To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" Subject: [added to the v4.1 stable tree] scsi: isci: avoid array subscript warning Thread-Topic: [added to the v4.1 stable tree] scsi: isci: avoid array subscript warning Thread-Index: AQHTPpSzv9HBt+ZTqUuFlrkbVRzs9w== Date: Fri, 6 Oct 2017 11:17:31 +0000 Message-ID: <20171006111704.25872-45-alexander.levin@verizon.com> References: <20171006111704.25872-1-alexander.levin@verizon.com> In-Reply-To: <20171006111704.25872-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the v4.1 stable tree. If you have any objections, please let us know. -- 2.11.0 =============== [ Upstream commit 5cfa2a3c7342bd0b50716c8bb32ee491af43c785 ] I'm getting a new warning with gcc-7: isci/remote_node_context.c: In function 'sci_remote_node_context_destruct': isci/remote_node_context.c:69:16: error: array subscript is above array bounds [-Werror=array-bounds] This is odd, since we clearly cover all values for enum scis_sds_remote_node_context_states here. Anyway, checking for an array overflow can't harm and it makes the warning go away. Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/isci/remote_node_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c index 1910100638a2..00602abec0ea 100644 --- a/drivers/scsi/isci/remote_node_context.c +++ b/drivers/scsi/isci/remote_node_context.c @@ -66,6 +66,9 @@ const char *rnc_state_name(enum scis_sds_remote_node_context_states state) { static const char * const strings[] = RNC_STATES; + if (state >= ARRAY_SIZE(strings)) + return "UNKNOWN"; + return strings[state]; } #undef C