Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2478655yba; Mon, 15 Apr 2019 12:29:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkqhY1UPaZ2sCM+CEqL1P8xiIXf8QTxZ5Ucfq3glxRVS0jrM7aBv6/UpFdVLgjmJIHlp+y X-Received: by 2002:a65:64c8:: with SMTP id t8mr71211671pgv.248.1555356588083; Mon, 15 Apr 2019 12:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555356588; cv=none; d=google.com; s=arc-20160816; b=vbsLhH71907C2aGmGVypcQvgKWPOY02YFqjTVIYMuDZ2nWTJfSSjLgVXq/eNKPAgSi 1u+92kMEWd3gPp60vod0DRUBdM5NH4noxKmLYwaLd54H+vp1GkTiVgUmp5V29R7EM9xv AuSYOmmUE0fqnDLzNFTlUW/4DkOwsll/iGwg/vTMdq4BibpDNeWpEnaYOGGNMK4YYF7R 0z7hAAvFQj9FjjNiHRgoa+tVOn+MwLYZ9ixxOVKhMT6JpSDNbrAT5ZA8i2n+5LUole86 Jwg8kFiroMKYaH7I4U8kExJCE0XLoTUJkxAaefs3p1MyK5OYKL49jtTQWKe26sp+tG60 /7Og== 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=e75zRnqDgnzk+kcr3mJS4fyieUPhTzY54+6KyH4ngrs=; b=I7jcKe3r3aNA8MAFlG+IiAGy56KbTQKweL1YAjjXwKD9qqbWZaarjSGV3OMcxwtQhh vM6+moV/2kxg7ai9rUMA+3nr3I7CJcHoRylRHvw8o/9Dkcr5Z1qQqgFIhiS48xjP+QSE ItTPRUyoFJOvZomIvx13KjNy1fpbnsFT/pde0jJDUBgbry39cArPQHB8eWa3v5iUN9Es XiBgBhuuuhZs4VR4E35x/0revt83eJydBGO9U7F2rED2jf7eHoXOnmiVtlFR6SGCQiRK xjspQtK5Fl2xEhoSonhEg+FTnVXlEWBQ2L1yuHiK5Qb19fpODgnlKSrMuAxDmGr7zic9 UQJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0Uq8KFkm; 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 s30si45739858pgk.5.2019.04.15.12.29.32; Mon, 15 Apr 2019 12:29:48 -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=0Uq8KFkm; 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 S1729180AbfDOTDR (ORCPT + 99 others); Mon, 15 Apr 2019 15:03:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:34970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728218AbfDOTDQ (ORCPT ); Mon, 15 Apr 2019 15:03:16 -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 45FBD20880; Mon, 15 Apr 2019 19:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555354995; bh=TRbjqahbdfBUxDCfCH+4t6kvwnI+9cf2RLkSjTmoMeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Uq8KFkmy8YFiLjRdChMFoj9RgLAQlfQAEQSchTbte2mrwlS1h826elni8fLI2/g8 Vu6UNy9fNNV4STbSakMX8graTslUyGU3nvcmZLTaYcYFWrAebND6UK63q3jgXZdq2V sXGX1fxfGMyW/djVQau32OTW+UKDe+7BPw4nZNtU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gavi Teitz , Roi Dayan , Saeed Mahameed Subject: [PATCH 4.14 28/69] net/mlx5e: Fix error handling when refreshing TIRs Date: Mon, 15 Apr 2019 20:58:46 +0200 Message-Id: <20190415183731.346586583@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183726.036654568@linuxfoundation.org> References: <20190415183726.036654568@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 From: Gavi Teitz [ 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: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c @@ -140,15 +140,17 @@ int mlx5e_refresh_tirs(struct mlx5e_priv { 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,