Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1749990ybg; Sat, 19 Oct 2019 01:41:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMl5fCf8SBUIW4o1u3wyjxdHh88zHvLIfxx2LpBxcDmAMPMFU9vAAlimkZ2Fv1zJT8LkFR X-Received: by 2002:a17:906:154a:: with SMTP id c10mr12162675ejd.238.1571474486689; Sat, 19 Oct 2019 01:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571474486; cv=none; d=google.com; s=arc-20160816; b=ErypxgMphoaSdNcTf8KkpmsmrA7SVDkZh1QtV0eibUnXsXgRWppy8xHDbnDy/H45Jg 3mgBc+zODBz0QMKOmPslY/17rk2uQ3Gkg4+1lB6QLFY2lr1rWDeBC85uw3gYvajHNo1z arDuekN831VhWeKIcliL482UVtq/sOIQuXfzz65Me4omdWTxyMel1RS/3gyNL7dfZR2G A7RmfQg7ifTH6hBNG7BOA8FcL/BMdkMoFwuD629qi+6ajLpXhQqJ1hSgcZNLTENhBB6R OtMCuBwg8Qs6GrvVuPtJufHZacOkR57RtH+F5wLm2DF1oEowmFCYCyuOsRj1depb3Kk3 Sprg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=1VjqIbKxzgSPDX6rPga3Rmp+ONChoM/nrb54oeDS71c=; b=brOmDwFXkvUICKk3CPxi9FPtb9hI+KwrXTT3pzYO9ZyXinrv6Po+pQ138KAhPnSJpF jWPlt1JXy69iQDG2Lj60DIK2kTDeKFEnNW8Hu+oJ04oudmH+yQjjHlnVEGkQSI9kKOSu ryiI1Ty+UVhgrwaRwQFRVmjr6jNwyHjLpbx+COBOv1XfyIb0kes0UgV7zldZgnTKiBCL JC0E6EcdL9e2JQRTjxFSQ6obrq/s4DrZBB/DUKwBAXL/2fLKNg1wHsYjKQ2cSJ5WDYy2 DgXbUKClWN2UsbNqwcVktDMm6M75UoQiyukLNfEHxhZ7trZt3DaeiuSsW53Td5igPocR hueA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si125429ede.324.2019.10.19.01.41.03; Sat, 19 Oct 2019 01:41:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436721AbfJRQVO (ORCPT + 99 others); Fri, 18 Oct 2019 12:21:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:43046 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727154AbfJRQVO (ORCPT ); Fri, 18 Oct 2019 12:21:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 63664B2D4; Fri, 18 Oct 2019 16:21:12 +0000 (UTC) From: Daniel Wagner To: linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dick Kennedy , Daniel Wagner , James Smart Subject: [PATCH] scsi: lpfc: Check queue pointer before use Date: Fri, 18 Oct 2019 18:21:11 +0200 Message-Id: <20191018162111.8798-1-dwagner@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The queue pointer might not be valid. The rest of the code checks the pointer before accessing it. lpfc_sli4_process_missed_mbox_completions is the only place where the check is missing. Fixes: 657add4e5e15 ("scsi: lpfc: Fix poor use of hardware queues if fewer irq vectors") Cc: James Smart Signed-off-by: Daniel Wagner --- Hi, Not entirely sure if this correct. I tried to understand the logic of the mentioned patch but failed to grasps all the details. Anyway, we observe a crash in lpfc_sli4_process_missed_mbox_completions() while iterating the array. All but the last one entry has a valid pointer. Thanks, Daniel drivers/scsi/lpfc/lpfc_sli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 379c37451645..149966ba8a17 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -7906,7 +7906,7 @@ lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba) if (sli4_hba->hdwq) { for (eqidx = 0; eqidx < phba->cfg_irq_chann; eqidx++) { eq = phba->sli4_hba.hba_eq_hdl[eqidx].eq; - if (eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { + if (eq && eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { fpeq = eq; break; } -- 2.16.4