Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp508551pxj; Wed, 2 Jun 2021 04:57:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTxU8wknqcvlM9NBnBIOKCsKwv1OObnmGu1s/wFrd0d8ZGoSQuqhjIqJfJxpxu8cFSoT/n X-Received: by 2002:a05:6402:22f9:: with SMTP id dn25mr13433902edb.241.1622635021734; Wed, 02 Jun 2021 04:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622635021; cv=none; d=google.com; s=arc-20160816; b=GxvSXvJYq/TApLApBXUYQUNQmd73ExMzz9tl0IeLElrvw7XN4Dmu801Eexk0v5pxfC M/4kbmJ2dWOJ7lHSDgMfRYgz0X1uxbQ9fwrci+D9JYSw2IO442knhBQHgGlGTh/0u3Ek cIVKnkIbIjKMAZeCrJZUYhQFquusHBfGi1bhMd/uhMsv8nFpFpfu1O1ern+BrzUamLmc nMM3WNsIo7lRgv8K8eK+fmOnIrYBuGRzsDHnxBANdRSa/AAeMIwq8z0B1unJ1O8Dc7Td gFDsqHBPGPXwvEJ6d9rTNNgDKqePO3EA5taEleWe982l5FfGJo7DoSlxoYL2wPInZDmw IQsw== 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; bh=3gzED9a4GZbyXLCRczOKQRTZ5GYHKxOCTaLqRHYSQL4=; b=tkKfoNBRRnP/Ubkk2wD7RhGtzaKC3PwPLv1tH8Vfo5/a+RhE4KNwzis6lZ8TOVW2W+ p3ehyaY8g4nW1lHH+RKmJw+s4aki3BlErzl8C9AuDxnxU24qy6nQnI769npUiqU3wqII nZjKvbOljogt1HAfm55AAL2yf60TAYaGjIagR4yCkzfhefsQrwfmLQ12vCUef8Eob9Vk 9rndTaROXUORFzxbuNWYBeGdE/gh+9Q/jSn/3NGQIV9cubktNAKPgi8LO3NzEYTDvxXq 1unttXBRzu06Z86EslXHNL/jo6BXQZD4ForSHHqwobWErz9Nx0HKYAwHJ1UGzfX6banV hotw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs19si16355410ejc.258.2021.06.02.04.56.37; Wed, 02 Jun 2021 04:57:01 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231839AbhFBKLG (ORCPT + 99 others); Wed, 2 Jun 2021 06:11:06 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:53392 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbhFBKLF (ORCPT ); Wed, 2 Jun 2021 06:11:05 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R541e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Ub2Yybc_1622628559; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Ub2Yybc_1622628559) by smtp.aliyun-inc.com(127.0.0.1); Wed, 02 Jun 2021 18:09:21 +0800 From: Yang Li To: saeedm@nvidia.com Cc: leon@kernel.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] net/mlx5e: Fix an error code in mlx5e_arfs_create_tables() Date: Wed, 2 Jun 2021 18:09:13 +0800 Message-Id: <1622628553-89257-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the code execute 'if (!priv->fs.arfs->wq)', the value of err is 0. So, we use -ENOMEM to indicate that the function create_singlethread_workqueue() return NULL. Clean up smatch warning: drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c:373 mlx5e_arfs_create_tables() warn: missing error code 'err'. Reported-by: Abaci Robot Fixes: 'commit f6755b80d693 ("net/mlx5e: Dynamic alloc arfs table for netdev when needed")' Signed-off-by: Yang Li --- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c index 5cd466e..2949437 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c @@ -369,8 +369,10 @@ int mlx5e_arfs_create_tables(struct mlx5e_priv *priv) spin_lock_init(&priv->fs.arfs->arfs_lock); INIT_LIST_HEAD(&priv->fs.arfs->rules); priv->fs.arfs->wq = create_singlethread_workqueue("mlx5e_arfs"); - if (!priv->fs.arfs->wq) + if (!priv->fs.arfs->wq) { + err = -ENOMEM; goto err; + } for (i = 0; i < ARFS_NUM_TYPES; i++) { err = arfs_create_table(priv, i); -- 1.8.3.1