From patchwork Mon Mar 20 23:45:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Keller, Jacob E" X-Patchwork-Id: 741302 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vnCHq5MRgz9s3l for ; Tue, 21 Mar 2017 10:45:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="CUp/EYPh"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 45FE187D94; Mon, 20 Mar 2017 23:45:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2W1tsS0AtEOq; Mon, 20 Mar 2017 23:45:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C51C787CAC; Mon, 20 Mar 2017 23:45:40 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 585BE1C2A69 for ; Mon, 20 Mar 2017 23:45:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5044287C4E for ; Mon, 20 Mar 2017 23:45:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r6A7ozLIFmy0 for ; Mon, 20 Mar 2017 23:45:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by hemlock.osuosl.org (Postfix) with ESMTPS id BB05181D4C for ; Mon, 20 Mar 2017 23:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490053537; x=1521589537; h=from:to:cc:subject:date:message-id; bh=LbeghES8SKLms+dj4f5NAizIxf5NSapWlg3Fp3PkWCQ=; b=CUp/EYPh3esjbaGTaVg0BbYutmUM8T7huXbEzev0hoKEP76SYX+bQukt y+RjbFusFrJvc36KUO9wj0wHZG/Wcw==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2017 16:45:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,196,1486454400"; d="scan'208"; a="1110500999" Received: from jekeller-desk.amr.corp.intel.com ([10.166.35.174]) by orsmga001.jf.intel.com with ESMTP; 20 Mar 2017 16:45:36 -0700 From: Jacob Keller To: Intel Wired LAN , Colin Ian King Date: Mon, 20 Mar 2017 16:45:35 -0700 Message-Id: <20170320234535.27900-1-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.12.0.rc1.272.g5157a0d593b8 Subject: [Intel-wired-lan] [PATCH] i40e: initialize params before notifying of l2_param_changes X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" Probably due to some mis-merging fix a bug associated with commits d7ce6422d6e6 ("i40e: don't check params until after checking for client instance", 2017-02-09) and 3140aa9a78c9 ("i40e: KISS the client interface", 2017-03-14) The first commit tried to move the initialization of the params structure so that we didn't bother doing this if we didn't have a client interface. You can already see that it looks fishy because of the indentation. The second commit refactors a bunch of the interface, and incorrectly drops the params initialization. I believe what occurred is that internally the two patches were re-ordered, and the merge conflicts as a result were performed incorrectly. Fix the use of an uninitialized variable by correctly initializing the params variable via i40e_client_get_params(). Reported-by: Colin Ian King Signed-off-by: Jacob Keller Tested-by: Andrew Bowers --- drivers/net/ethernet/intel/i40e/i40e_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index 191580ed946d..725017892f4f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -147,6 +147,8 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi) dev_dbg(&vsi->back->pdev->dev, "Client is not open, abort l2 param change\n"); return; } + memset(¶ms, 0, sizeof(params)); + i40e_client_get_params(vsi, ¶ms); memcpy(¶ms, &cdev->lan_info.params, sizeof(struct i40e_params)); cdev->client->ops->l2_param_change(&cdev->lan_info, cdev->client, ¶ms);