Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2461448yba; Mon, 15 Apr 2019 12:08:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgIDWbOFcx2tDCuJby+5yx/vrTpkYx881Koa+nWJNdaK7OlruXmJf/u9U/Zrx9GY3jNARB X-Received: by 2002:aa7:884b:: with SMTP id k11mr77422902pfo.49.1555355294943; Mon, 15 Apr 2019 12:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355294; cv=none; d=google.com; s=arc-20160816; b=BGjw09+aBSjpmYuCsGlfNIbC2pPeBzBk0wUktMeXC7qPa5H5f3i0ABuZGyogf034Eq bp70q0OC4wjsn5T26LN0IhsnVcDn+6JlbeqLEDOFVySvHNDrAFMcBdca7Ie2ru82LT9h 7WESG/tl/gIxKXoppTBdenfgzLD20NMhj7n1uxhNSilOXXoUGlbxEY6KMJsfyiHi+Mr1 QW3PKErM9TikNYAWJQICFcK4drehouWNEzbJYv/q0ntuUmoDOHYmtT6uDH2K+37JU1/W w1vxZlB8q1Xntj+x0JYo9NmNCR+jg7nsDhflXlbVVdHzf91VqXEFl6lRIiI/wETk+A// CPNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ICdJci5zQrdfkftc6wJzGFB3JEFV2zrqmHDfVpC9o1o=; b=TuyhRfQCUo6kLFzOkVA6WJQgTSwohDdwHEeScqK2+1B0iCs6sMrCX+e/z5Ygk6Qv0M OvCJsmqQH0cz6nzA6Yn05SW4T/tiDFgh+SaduMkxTll9XvRgI6VFTCA7n2CesRzCTArQ BeBqCFOjoDgTJhccrg+rXDARow0eoKSi+6n1eUqNvZ1I+cMuRxXfnlCsPLEZR3f/1zEx VtLZczys+lxCLHLUhAI7YKvFLHLC6EReO83P4E1ACU7pI1RN8bWMH+6LLiMy2TIdbcgH 8TjgJ7LsdtHadPtvdBx2A4LON6VWmbmRQZm6fXckUvfme0GbfS3zYDuBYEnMXmSBK42u YKgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i0KLK59L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n69si13851151pfb.256.2019.04.15.12.07.59; Mon, 15 Apr 2019 12:08:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i0KLK59L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729044AbfDOTFe (ORCPT + 99 others); Mon, 15 Apr 2019 15:05:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:39236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728676AbfDOTFa (ORCPT ); Mon, 15 Apr 2019 15:05:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ABA8A20880; Mon, 15 Apr 2019 19:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355130; bh=Q5t/ZpIuEHr9VcRVMT/rXDvFpLjW2wV+nfj3KObQQcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i0KLK59LdTo7VwGvNI7v3rbXKA3plgavaplcRzdKl8KKzmSMVn9phEYYTferfF90K AjpRKB+AXJTsnoLkXPQYQMZKAyxn1z4dBGqJleYmX4t/bCUU8ECdvBRRA8fsUlgA1R ihSniZlmQbTjSm3xroV9Irhs6UeyOHekrf57022Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gavi Teitz , Roi Dayan , Saeed Mahameed , Sasha Levin Subject: [PATCH 4.19 024/101] net/mlx5e: Fix error handling when refreshing TIRs Date: Mon, 15 Apr 2019 20:58:22 +0200 Message-Id: <20190415183741.670232784@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit bc87a0036826a37b43489b029af8143bd07c6cca ] Previously, a false positive would be caught if the TIRs list is empty, since the err value was initialized to -ENOMEM, and was only updated if a TIR is refreshed. This is resolved by initializing the err value to zero. Fixes: b676f653896a ("net/mlx5e: Refactor refresh TIRs") Signed-off-by: Gavi Teitz Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c index db3278cc052b..1e28866e3924 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c @@ -141,15 +141,17 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb) { struct mlx5_core_dev *mdev = priv->mdev; struct mlx5e_tir *tir; - int err = -ENOMEM; + int err = 0; u32 tirn = 0; int inlen; void *in; inlen = MLX5_ST_SZ_BYTES(modify_tir_in); in = kvzalloc(inlen, GFP_KERNEL); - if (!in) + if (!in) { + err = -ENOMEM; goto out; + } if (enable_uc_lb) MLX5_SET(modify_tir_in, in, ctx.self_lb_block, -- 2.19.1