Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1379862pxb; Thu, 4 Mar 2021 09:49:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQzGzEC9uuZhFftg4Np6cG4pMUWMfVpVZ7h0f1ko++TQiZbYimXYYJoKZTKKU3BUFalZI3 X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr5486759ejb.540.1614880151639; Thu, 04 Mar 2021 09:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614880151; cv=none; d=google.com; s=arc-20160816; b=Ip22pm976tuVFRFSOSwWb5btCL4iwXdPHu692JqPx0Edss0MCUmFrXSj9HER0GTUUy 8bxPooK2K5uVsXWMqlxNSOOgjvnLNMLBOls3MDMjmvLjvWHRH2Ol+VbamE+9Yy937aw3 jHkIHC10xT1PrPpUwIIEu9tdJZ+tZu3OaliYvmjuiHRfJHA5C9ObVTK1jbf0KHpriDFU 4RQtCV3r4VV505bt2Vb5SMhiU4L0OJaPDsET5oCrUw1Bwt888oNQ3QntPvrFzeNvyzJ1 Wi16PEEi0kKFk3IGej/8tk83rbBXBXdCFdMeRIFLlxlcRtzMgxTetO5JobXhOJx08uq6 oY8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=LBqlEZyPcKTt510snqgHtrJs4QRW+RndpggZVW6Cb+U=; b=K1igqCGGJaRzS6/O8dXmoV0LbmyKcohFko+jvEcFWXm5UbFJILYQNEX56HERdJkmy5 JOGgBKMjGHaWLtlGmqHCNh3advOX1sEwqjuRj4NAE9j5CZoRM3oviPXvA5uljdjE9ERz SbD860BSQm12YXJEZyob2+UajqvE1fmrqAvorBjKA7onW7/3EAA2XtN4OycF5tRUZ54E HYbqf6XKIzpG6iNmldU2/Hwp7lDf0ZSZHMFHdPGbWdrUL+BIQ/Ox6QV3/UjO4fWfMhl/ xmz8/7s8AZun6s2SmTFWObEeS+KVRdjrTCvKcfVtRBHIRmju1QQ6heaa4AX0DhhOOxb5 5aWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qtwFImKX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si15392426ejk.173.2021.03.04.09.48.48; Thu, 04 Mar 2021 09:49:11 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=qtwFImKX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241817AbhCDOTb (ORCPT + 99 others); Thu, 4 Mar 2021 09:19:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241785AbhCDOTC (ORCPT ); Thu, 4 Mar 2021 09:19:02 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F99C061756; Thu, 4 Mar 2021 06:18:22 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id a4so18963467pgc.11; Thu, 04 Mar 2021 06:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=LBqlEZyPcKTt510snqgHtrJs4QRW+RndpggZVW6Cb+U=; b=qtwFImKXhr7tSBAHx4h06wq7ZHcxq94ai6Fpd1sBmD+6WVbNfohmeL8bkmQZtT3Xn4 BPsC2/bYDPPP/cFr+PoTaySPMZ36aZFfSqKJLvhEXXMFCJscqv+qNpjHdaMiqCWQwZMg 4XgjY8eiphEDPWolW9izecbXkm+L5Hljb05iHeHlvKmFIOIfpun57GkrdZuJ9iAlSK7L kX+DZRRVmI9C1CdyvVw4tJS8Gf/6P/lF1VPEQMWAfKUza50s28hJBCVPwbpC+LxNh4UO 3R2CmAi6HJEXAU3MF9SDKlr5nxP12NdSaCk6AnIpE6e0DbtA/rJ3YHHzoRGOiQSUReQB g6kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LBqlEZyPcKTt510snqgHtrJs4QRW+RndpggZVW6Cb+U=; b=Tpns1et2D12YHwBPFJ289ip57QUzNI777/Mqatd3Ta5SUSUeppHBq7fiydA0jBqXeA Z7gXBH/7fTeCq3NT7LLeieFCehIn1TWI/jV80EI59NngEf0nwyXR8wkE4dTEnwepilKE OQLx40izqOHTuWvcCHrftyOfYyf1CbAsd0RyMzP8OVY+KUiz37bW3ngT88Ug1QfO3QTC aeYueWVhlMbXZ1dmrsZEgcbuHDbjoZvSOqY2eKId5IK3CfUAwJE0nbrq/FDfNGi/rETb Gz27qsPxqlkIcYrO3KTS9eW9JHIX8npmzTC8WwO5Fr6Z8mbpOqWfE8YbUo07rY0Llf1k UjBw== X-Gm-Message-State: AOAM533K+KbuQ2IIvXOkAdb4YgiC2Wgdaf5/bGtSk2ePO0MN1opOShfa Y+cAIYckYKfoBhqY5MdXSGE= X-Received: by 2002:aa7:9711:0:b029:1ee:b2c7:ecfe with SMTP id a17-20020aa797110000b02901eeb2c7ecfemr3928358pfg.58.1614867502027; Thu, 04 Mar 2021 06:18:22 -0800 (PST) Received: from localhost.localdomain ([45.135.186.129]) by smtp.gmail.com with ESMTPSA id x14sm28445213pfm.207.2021.03.04.06.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 06:18:21 -0800 (PST) From: Jia-Ju Bai To: borisp@nvidia.com, saeedm@nvidia.com, leon@kernel.org, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: mellanox: mlx5: fix error return code in mlx5_fpga_device_start() Date: Thu, 4 Mar 2021 06:18:14 -0800 Message-Id: <20210304141814.8508-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When mlx5_is_fpga_lookaside() returns a non-zero value, no error return code is assigned. To fix this bug, err is assigned with -EINVAL as error return code. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c index 2ce4241459ce..c9e6da97126f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c @@ -198,8 +198,10 @@ int mlx5_fpga_device_start(struct mlx5_core_dev *mdev) mlx5_fpga_info(fdev, "FPGA card %s:%u\n", mlx5_fpga_name(fpga_id), fpga_id); /* No QPs if FPGA does not participate in net processing */ - if (mlx5_is_fpga_lookaside(fpga_id)) + if (mlx5_is_fpga_lookaside(fpga_id)) { + err = -EINVAL; goto out; + } mlx5_fpga_info(fdev, "%s(%d): image, version %u; SBU %06x:%04x version %d\n", mlx5_fpga_image_name(fdev->last_oper_image), -- 2.17.1