Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2563463iob; Mon, 16 May 2022 00:32:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD10LLyVrHftJGaKYsGAFSLzaakNpugTMXF2Nvwaxd+svCcgaLF9jTVa00kdrD9INo6wgm X-Received: by 2002:a05:6402:3705:b0:42a:ba63:18b7 with SMTP id ek5-20020a056402370500b0042aba6318b7mr743443edb.296.1652686352767; Mon, 16 May 2022 00:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652686352; cv=none; d=google.com; s=arc-20160816; b=VbHn9cExRkhCx+vpwBRQFI78uHZMx5lK9PGIyl/q0zN7AGykAwaSy4/oQQZTI1y9Xt kiCN4K6jZq17UudcM1GzUgsrb3B7vw+jQZiK9CEyBPYmjeDhjNGPjxe8k7sKcsol4oC+ dFeq6eZsFbrVM/nwyua1f5mUM/lsDcXji4D0ohzsji1IChx7Pbyo+UND6khQVQcddvuk rsv93BRcMVYYOaOPxElVgYuNOlr4MlN2qA/u4zemgzCXTn/TyxjEpbUxo6FPIoxIXJvd OzIitgzkbyI6S74+KjrpOetLyvZmQjF99wT4MM/+9eNzzCgRno3LSteDVcRgU3fpq1bE 7NKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5Zsd0AiqAitEo/+FKXwThSMfbAex1Xe9ICvOdMNq3H8=; b=ZcTF1otgkh0GwngIQGZhqssuWdOV0DYEzq6PaQ8rBGfHHICxL2TjZJRfu+g2i6CbA5 VJhn5+dVCkcb0hz6KW/1mA3wV3Qixp+0ZGjUVeCbDvxBkTEwjfK2MbRjwr6AiYGFZLa8 goCxTPUfNE184DmmazQCDTzefzjwk3i154h/5HgX5RAGchlOT75j/4/bEpK8BXGaS71L rYRYppcBghpPUqfxUi6Zc2TiwwaIvz+4Evf6FXD+Fz+j7fQSWxWGM29srm9UgM9+uHS4 PtF4LqZlRlyfo9AuBjWew0FgmH6zD5+RBxbdyAOLgbRVqsJEMmIQLC3DNEjwm0TbluW5 XyjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt21-20020a170907729500b006f37bde5a2csi10945402ejc.693.2022.05.16.00.32.07; Mon, 16 May 2022 00:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235104AbiEOP7G (ORCPT + 99 others); Sun, 15 May 2022 11:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbiEOP7C (ORCPT ); Sun, 15 May 2022 11:59:02 -0400 Received: from smtp.smtpout.orange.fr (smtp07.smtpout.orange.fr [80.12.242.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F9BD1409B for ; Sun, 15 May 2022 08:59:01 -0700 (PDT) Received: from pop-os.home ([86.243.180.246]) by smtp.orange.fr with ESMTPA id qGcCn0Tbaqn1xqGe3nISmG; Sun, 15 May 2022 17:59:00 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 15 May 2022 17:59:00 +0200 X-ME-IP: 86.243.180.246 From: Christophe JAILLET To: Veerasenareddy Burru , Abhijit Ayarekar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Satananda Burla Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH 2/2] octeon_ep: Fix irq releasing in the error handling path of octep_request_irqs() Date: Sun, 15 May 2022 17:56:45 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the error handling to work as expected, the index in the 'oct->msix_entries' array must be tweaked because, when the irq are requested there is: msix_entry = &oct->msix_entries[i + num_non_ioq_msix]; So in the error handling path, 'i + num_non_ioq_msix' should be used instead of 'i'. The 2nd argument of free_irq() also needs to be adjusted. Fixes: 37d79d059606 ("octeon_ep: add Tx/Rx processing and interrupt support") Signed-off-by: Christophe JAILLET --- I think that the wording above is awful, but I'm sure you get it. Feel free to rephrase everything to have it more readable. --- drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index 6b60a03574a0..4dcae805422b 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -257,10 +257,12 @@ static int octep_request_irqs(struct octep_device *oct) return 0; ioq_irq_err: + i += num_non_ioq_msix; while (i > num_non_ioq_msix) { --i; irq_set_affinity_hint(oct->msix_entries[i].vector, NULL); - free_irq(oct->msix_entries[i].vector, oct->ioq_vector[i]); + free_irq(oct->msix_entries[i].vector, + oct->ioq_vector[i - num_non_ioq_msix]); } non_ioq_irq_err: while (i) { -- 2.34.1