From patchwork Wed Dec 16 23:11:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7866641 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65E7A9F387 for ; Wed, 16 Dec 2015 23:12:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AB60202FF for ; Wed, 16 Dec 2015 23:12:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48BFD203E6 for ; Wed, 16 Dec 2015 23:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755289AbbLPXMV (ORCPT ); Wed, 16 Dec 2015 18:12:21 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:33350 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754948AbbLPXMP (ORCPT ); Wed, 16 Dec 2015 18:12:15 -0500 Received: by mail-pf0-f170.google.com with SMTP id n128so853190pfn.0 for ; Wed, 16 Dec 2015 15:12:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=zTV5avK5S1mwH9ddX1LZQeWVAdX3M+ZRQCh0M+1zcP4=; b=GuAjWX55z3IE6xtHyPjsN9VXRV6k8WQ1R/d8UNd3aYAhyPynsrVV/vbCOsBeU8xgW6 T3Ay3RcBeXymXiSsL4weJXGLZuV6ASlVZLyDtf4DLzzZGOCCG+1JFw1yWqsxrEGVa+w3 KnJqubF4a3Pd4vMM7oFAizkaJhv4DPb/atcA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=zTV5avK5S1mwH9ddX1LZQeWVAdX3M+ZRQCh0M+1zcP4=; b=OwcH8XkJRbKacOX9p70K5tacvKip4dAWAXBXZ+f4l25djU4tXMKBKkM6/RK18PO8Dl aNtP0ZOtAYGXCi+ZOoarkWMW2R8r5IrVkCI7eLwzz13mNCw8oyKOQYYBKxuzn9MAkQG+ l6+vJkXzziml3thUnKwqzSUkEInV9pcXFEgIF+MfhaDUlXrcOEDcO8Db/iQnecLkajz1 +hLUaakCZA2r5ZfEupmp3NZTAl2VKaL37tJMXP+vnOW2IMq721KEZ/J7H2rCqKzPrkRh IlVJT5CuJeKNew6HcUmCp6LF13FkWF9/lqBU/ZlKIIWQ6PhyMrkOEoMvgdHR58mk7X8L +VYg== X-Gm-Message-State: ALoCoQmZC4UCOUcaGkcBlyRpWU2OrZ8OP+vMw9++MDdhcm+FbPuU2fet7c7PTaJ38qaNG6wolTOXfWvG/VijLDxtuIBQhJkwRw== X-Received: by 10.98.11.7 with SMTP id t7mr9635237pfi.51.1450307534907; Wed, 16 Dec 2015 15:12:14 -0800 (PST) Received: from myfc17 (cm-wififw.emulex.com. [138.239.220.50]) by smtp.gmail.com with ESMTPSA id w27sm7009140pfi.36.2015.12.16.15.12.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 15:12:13 -0800 (PST) Date: Wed, 16 Dec 2015 18:11:56 -0500 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 05/17] lpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16 Message-ID: <5671efbc.dvhEy//FvbpoWxN6%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix driver crash when module parameter lpfc_fcp_io_channel set to 16 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index ab27d81..bd6aa8d 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -8833,9 +8833,12 @@ found: * already mapped to this phys_id. */ if (cpup->irq != LPFC_VECTOR_MAP_EMPTY) { - chann[saved_chann] = - cpup->channel_id; - saved_chann++; + if (saved_chann <= + LPFC_FCP_IO_CHAN_MAX) { + chann[saved_chann] = + cpup->channel_id; + saved_chann++; + } goto out; }