Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp606465pxb; Mon, 25 Oct 2021 14:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCjkoAtI/h+TDG8oSek+9+aHve34smJIFkn391JasoNXBQiOWKVlhznCub/mwLqBZNKJTp X-Received: by 2002:a17:902:eac2:b0:140:1d32:ed16 with SMTP id p2-20020a170902eac200b001401d32ed16mr19141701pld.64.1635198625737; Mon, 25 Oct 2021 14:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635198625; cv=none; d=google.com; s=arc-20160816; b=Nj2xoReWYAtWsgRUIfX3lYp69KxDGCxyxFbd8lsrGAykHB2c4DTXv1y0vwPRaPci7A toSY0phWIO7/g2A5g78NWEEdv0LoYKx8bCxX1+Ov+UYjusYcGiKtRyjmrV63rWAYVLoR ZazruONzqKM2vo17SWoOnKAeWt/1zOf7NYfPzm+8d0HCDtFaVuHS5NINj2Y2DmLf7ixG AE3HyVIPd3r6aYK+3tUUxa4wVw5W0H0Leot+MKeEDpYgvRSFh5TJEpkf4oV/YNUC6wsa C0epHcYZvy+B5JUbhDmjCbhVzk5GKkWwCQqj7asF06SjzC4jACxAEfTVmLwmmFprQmuz QTIw== 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 :dkim-signature; bh=qm8LgALsDIzXaSVDVrm03UyVv9j+O4EC7bbhZ+anjBo=; b=w8gRnT0RRhKWKOZDy3g83VuRgoUSvNP/ayUtLz84lS7eMARhB9alXmXcrftenLueC0 fNeZbYfgB1i/gU/HhVjZyxXC2Ydk/F6Phk4Rr0TfSGpzrf7NGoPonSwZG/AkQfSu4mIi NuvAPCRtUA7KE/330x5DTXMalWUumEVpagrWxEUKiqHlQtdcRRPgN+Rc81aN/uWA6fMP tYBUPwbOl98AV0rAN5he6AGAnIGisxgUdEDavghv5ZN+OPb8iqQQ52wd/6ivNhGlRXF/ 5I7hQZNZcRoipb4zYr5X4o1ev2V12hChxONsiylC6vijdX9XnWdW4EzlF0YpJspIRQgj rYXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jp0+jNv3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nv14si32490877pjb.155.2021.10.25.14.50.12; Mon, 25 Oct 2021 14:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jp0+jNv3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234213AbhJYRDB (ORCPT + 99 others); Mon, 25 Oct 2021 13:03:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:55064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234272AbhJYRCh (ORCPT ); Mon, 25 Oct 2021 13:02:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 967F760FDC; Mon, 25 Oct 2021 17:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635181214; bh=Zi+X0CHUBXp8Eeb2+fbHZbqEmRXZzxKBUizEuKnew4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jp0+jNv3Y+BZdKQIRcH6HmRyVKmYNsa2g43/0iS6SPxocQEb7PmF7z+i9QWcu9XH0 oIYI3o6UkCmyEV4yPNPykMUtFT8CYZT4Py1TrB5wbZjAYkxO9BCP9EwIvCDTjRXkFl nXVy0wV4bvYaw2hs6NM9NjCwai2hfq8MQVxtkXdFbOlAERcwkcYz1CyEKeAHxFLT9r NnXKVTZrV+8lZWh0XdpIQ4VaoRp/gCwaFO9I2pT9xWIQr/I/AYdztBGctPtS2yTStl qlpp9d6C6pkVYv0k8iK1XDmlaSq7DHn5p9VNt2IolqN+ij+kxy16Cyv/OSSBNxrEVE G8MBcPQRt/4dg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zheyu Ma , "David S . Miller" , Sasha Levin , sgoutham@marvell.com, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 13/18] cavium: Fix return values of the probe function Date: Mon, 25 Oct 2021 12:59:26 -0400 Message-Id: <20211025165939.1393655-13-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025165939.1393655-1-sashal@kernel.org> References: <20211025165939.1393655-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheyu Ma [ Upstream commit c69b2f46876825c726bd8a97c7fa852d8932bc32 ] 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/nicvf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index e2b290135fd9..a61107e05216 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1224,7 +1224,7 @@ static int nicvf_register_misc_interrupt(struct nicvf *nic) if (ret < 0) { netdev_err(nic->netdev, "Req for #%d msix vectors failed\n", nic->num_vec); - return 1; + return ret; } sprintf(nic->irq_name[irq], "%s Mbox", "NICVF"); @@ -1243,7 +1243,7 @@ static int nicvf_register_misc_interrupt(struct nicvf *nic) if (!nicvf_check_pf_ready(nic)) { nicvf_disable_intr(nic, NICVF_INTR_MBOX, 0); nicvf_unregister_interrupts(nic); - return 1; + return -EIO; } return 0; -- 2.33.0