From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA38033D505; Sat, 12 Sep 2026 13:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221259; cv=none; b=gP/mb6zfPnoDjjb7U9xgZHKpHrTNfxJfMy76pePXEg/I3i8/catGH0vV86ZmzFgatVgqk0sv1uE83EwW3v6feg0QIYhvYJwWqGN2xUN+PZ1sE9kXVfCLDid7ijNgx6B1K1j2ENRoW9FNb2D/kW9XiNjFr/Rep68DNbFqhUSjTy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221259; c=relaxed/simple; bh=IzhYvGpZT6//pB5tlhSN2pLWEzJJaZE+VtCKXY++AmU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aRElgxT0kJ/aF8N3LqLsgDQ+U5UNUPAR447b6KstV7N09fnNYkKrZW8nDEm9ovxuj8Xm3+yOQXqTLyb/1xPmdOTegSLfJ2HpGdenaMo457RmM6RuKmH1nNfSLrVinqooxSovr7mKZVETE2oqDWyw+r0RlgNE+2wY1JA1IZ3Bobs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r7sSKdcJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="r7sSKdcJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D3061F000FF; Sat, 12 Sep 2026 13:54:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789221255; bh=Vtu4Z7fSrwLDVEIlbrVV1TduMK51qOu29BAnTuGzf+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=r7sSKdcJ8WoSTRVRq2+ViyDpVVadVOekADmt/4DmAEa4RasVefEXZkitGL6JFMnHv UasJ9fODDFnl4bE6wen4Zm0aclXuJAG76T1RDKdlbhIJlL1NUs10KXeU5oiKmkbh6R 7+Gf54hXU9gfvDZ517I+bLpqsUFmMJw2j/5VQdEM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Runyu Xiao , Jack Wang , "Martin K. Petersen (Oracle)" Subject: [PATCH 6.6 0343/1424] scsi: pm8001: Use rollback index when freeing MSI-X vectors Date: Sat, 12 Sep 2026 08:46:15 +0200 Message-ID: <20260912065614.967239814@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Runyu Xiao commit 3f92a64545165bdbb36dee8fa35626b295463313 upstream. pm8001_request_msix() unwinds previously registered handlers with free_irq() when request_irq() fails. The rollback loop uses the failing index i for every iteration instead of the already registered vector index j. That passes the wrong IRQ/dev_id pair to free_irq() and leaves the earlier handlers installed. Use j for both pci_irq_vector() and the matching irq_vector entry in the rollback loop. Fixes: a76037ff3479 ("scsi: pm8001: switch to pci_irq_alloc_vectors") Cc: stable@vger.kernel.org Assisted-by: Codex:GPT-5 Signed-off-by: Runyu Xiao Acked-by: Jack Wang Link: https://patch.msgid.link/20260824113618.2239100-1-runyu.xiao@seu.edu.cn Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/pm8001/pm8001_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -1014,8 +1014,8 @@ static u32 pm8001_request_msix(struct pm &(pm8001_ha->irq_vector[i])); if (rc) { for (j = 0; j < i; j++) { - free_irq(pci_irq_vector(pm8001_ha->pdev, i), - &(pm8001_ha->irq_vector[i])); + free_irq(pci_irq_vector(pm8001_ha->pdev, j), + &pm8001_ha->irq_vector[j]); } pci_free_irq_vectors(pm8001_ha->pdev); break;