Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AADAC4332F for ; Mon, 15 Nov 2021 18:58:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3478E61AF0 for ; Mon, 15 Nov 2021 18:58:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243399AbhKOTBM (ORCPT ); Mon, 15 Nov 2021 14:01:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:57858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237732AbhKORju (ORCPT ); Mon, 15 Nov 2021 12:39:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F349363272; Mon, 15 Nov 2021 17:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636997173; bh=L7NEpTlyYyiobl5GSjv62Sk7HZv4zLiUjSV4LlnqAJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zyLIJAi+ZzvyWdgWP6Fw+w04VrFH1v362ThdSqcxHwBDwde+deufWsXdlbSGE//zi hEgetMkyg6SKB1JlCPfvzVSpiACGKkbhvXvlrDELWHvMqpuQ32phJHeC6cvYc+GVaO +P0eEmml0JLFabqM+cbotExxtEML+EBq2Qkst+CA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 052/575] cavium: Return negative value when pci_alloc_irq_vectors() fails Date: Mon, 15 Nov 2021 17:56:17 +0100 Message-Id: <20211115165345.434651056@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165343.579890274@linuxfoundation.org> References: <20211115165343.579890274@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheyu Ma [ Upstream commit b2cddb44bddc1a9c5949a978bb454bba863264db ] During the process of driver probing, the probe function should return < 0 for failure, otherwise, the kernel will treat value > 0 as success. Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cavium/thunder/nic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c index 9361f964bb9b2..816453a4f8d6c 100644 --- a/drivers/net/ethernet/cavium/thunder/nic_main.c +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c @@ -1193,7 +1193,7 @@ static int nic_register_interrupts(struct nicpf *nic) dev_err(&nic->pdev->dev, "Request for #%d msix vectors failed, returned %d\n", nic->num_vec, ret); - return 1; + return ret; } /* Register mailbox interrupt handler */ -- 2.33.0