From patchwork Wed Sep 4 19:29:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11131271 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13BF71395 for ; Wed, 4 Sep 2019 19:29:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E806D22CED for ; Wed, 4 Sep 2019 19:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730724AbfIDT3T (ORCPT ); Wed, 4 Sep 2019 15:29:19 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37129 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730584AbfIDT3T (ORCPT ); Wed, 4 Sep 2019 15:29:19 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i5axv-0002Yt-5v; Wed, 04 Sep 2019 19:29:15 +0000 From: Colin King To: Maor Gottlieb , Saeed Mahameed , Leon Romanovsky , "David S . Miller" , netdev@vger.kernel.org, linux-rdma@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] net/mlx5: fix missing assignment of variable err Date: Wed, 4 Sep 2019 20:29:14 +0100 Message-Id: <20190904192914.19684-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Colin Ian King The error return from a call to mlx5_flow_namespace_set_peer is not being assigned to variable err and hence the error check following the call is currently not working. Fix this by assigning ret as intended. Addresses-Coverity: ("Logically dead code") Fixes: 8463daf17e80 ("net/mlx5: Add support to use SMFS in switchdev mode") Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index afa623b15a38..00d71db15f22 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1651,7 +1651,7 @@ static int mlx5_esw_offloads_set_ns_peer(struct mlx5_eswitch *esw, if (err) return err; - mlx5_flow_namespace_set_peer(peer_ns, ns); + err = mlx5_flow_namespace_set_peer(peer_ns, ns); if (err) { mlx5_flow_namespace_set_peer(ns, NULL); return err;