From patchwork Tue Feb 26 07:25:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 1048167 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GV4agYtf"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 447r2R4g59z9s2R for ; Tue, 26 Feb 2019 18:25:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbfBZHZt (ORCPT ); Tue, 26 Feb 2019 02:25:49 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35677 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfBZHZs (ORCPT ); Tue, 26 Feb 2019 02:25:48 -0500 Received: by mail-wr1-f65.google.com with SMTP id t18so12691310wrx.2 for ; Mon, 25 Feb 2019 23:25:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=lNFvSkgW/jKpnbnwgW8K8ky1ndwujEcriswv7EkEbTM=; b=GV4agYtfMx+PNWFdy9afkymTJYKAwHfY7cRhl7tAiXO/R/mwrYq2iqeUjuop1ijxt5 EYCqxSvzXf4iHf2kkR4nqgUuQCKSxsflpZ+SdDOdIgmii8/9Q/eeocirHkZ07NvuxyTt v5h2xaYbPrAtEs9tZVl/3SL34eTyGGAof2nFJjer8blWcqS3ZqKP4eOxIOPt47JHToWS SpvccZxtzdFBLXo+FsMT5DkTWEQMKBq6hRHa9Djs9KZvG1quqy6giM4eR4eYjiossUiN 90ffG0/lHAUL6dY1abV+6i8hbjulXiaOxGIuT06/OwFkYe2O7FPnudLCcA8/amlZ+gdY GeKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=lNFvSkgW/jKpnbnwgW8K8ky1ndwujEcriswv7EkEbTM=; b=d2Qz2DdVY79wjDM/LxoCAP8dIF+MskYIHEU1CWlSZHY1TVXk2I3CH4yFQgdQ5KzoYW vdfLxThbI1k6ajQL2Fuugfh2U7+AjKyzgJe7nhYlICpmn0Nk3p2Fy47LPs4l2EG8uNuj 3BpgVepMywZlJBz/ScRm5nohNXcoJymZ6oTjeulhoppJJaOiibVzMBmdytbfslA28nYJ 0Po9JYvIGY8wQW5AoRpD9316jLmksj7oK30c13Xl3exQvo6Grug5rC+WUSYmsuqdaNM7 0wNb8t6Zj2g87JBzxNY3AY9FLlQu+TahsZc8cNkGVHUi80y9mKuDPfvGpSOtmcWdYB0h ScrQ== X-Gm-Message-State: AHQUAubBNgro+tBe7WZmbBDdFvdEQWBZYDFWidSmkitzCdbGKAQY4QFk Jn3yW6Zka8ySuoSrrcDPHgzayejX X-Google-Smtp-Source: AHgI3IYXlbgdIIA/pfUVQYhhR+OW1A3VDbzK3W4I86kNy98VncXKlaC/j024zfgUn/kMo3m9B2idlw== X-Received: by 2002:adf:b601:: with SMTP id f1mr16036449wre.158.1551165947107; Mon, 25 Feb 2019 23:25:47 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:10cc:f3cd:165b:9669? (p200300EA8BF1E20010CCF3CD165B9669.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:10cc:f3cd:165b:9669]) by smtp.googlemail.com with ESMTPSA id r6sm8910179wrx.48.2019.02.25.23.25.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 23:25:46 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 net] net: phy: phylink: fix uninitialized variable in phylink_get_mac_state To: Russell King - ARM Linux , David Miller , Andrew Lunn , Florian Fainelli Cc: "netdev@vger.kernel.org" Message-ID: <6c710eec-a299-5239-dde1-097209e8868d@gmail.com> Date: Tue, 26 Feb 2019 08:25:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 Content-Language: en-US Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When debugging an issue I found implausible values in state->pause. Reason in that state->pause isn't initialized and later only single bits are changed. Also the struct itself isn't initialized in phylink_resolve(). So better initialize state->pause. v2: - use right function name in subject Fixes: 9525ae83959b ("phylink: add phylink infrastructure") Signed-off-by: Heiner Kallweit --- drivers/net/phy/phylink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 59d175a5b..a9954c205 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -324,6 +324,7 @@ static int phylink_get_mac_state(struct phylink *pl, struct phylink_link_state * linkmode_zero(state->lp_advertising); state->interface = pl->link_config.interface; state->an_enabled = pl->link_config.an_enabled; + state->pause = MLO_PAUSE_NONE; state->link = 1; return pl->ops->mac_link_state(ndev, state);