From patchwork Thu Jan 18 13:17:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124949 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp122204lja; Thu, 18 Jan 2018 05:18:02 -0800 (PST) X-Google-Smtp-Source: ACJfBouuUFdMD+UV4jcA1ZfyOoDgAzoZ4NGjvtl7T2Pk9GxelkPM7hjjf9dyQtasBqkA6tKGBokt X-Received: by 10.99.39.70 with SMTP id n67mr37137551pgn.323.1516281482332; Thu, 18 Jan 2018 05:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516281482; cv=none; d=google.com; s=arc-20160816; b=oZ4u/5R+B0j0j08ktHzsdZaOt0u1nvInKlsGiZVVnVmR5ztqEI9fxdv/qTgNTzm82Z HvldkIzJ7H31kv4BPsR7q/B+oVghPYHs1yrkCrPfFKftv7FWbwH+D3yFs6rXF8vH/9l/ WUOP2466fGkRadCrP1+EKMhqBIg9bATyvEAqBgV2xtx/Fq6OXQzKX9+FvkF5hVf11TX4 Yi+ZMx/ruSPnJfBma7j1naGG/uKJ/oNpz/lzrR8x3LX67mTqNfrbpvXZ1VopdWi8S7s5 Q8ZJIqG7q2Z5F5OUfgtPaRG6H2bxceERUOeCNJdDnIVt7/7HaZN+eL7C7UKD2yrCJ7fz TkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=aFvXZpYvFnN7Mn2y53GXBjR0fiMNP6kLGmPoqI6ESp8=; b=HYzGQrHgPCsAUTOKoyNbJc3AHbArgPolozmXlwQ9MAFWq9Ez8d0JhpXjRqory7jJrc q9vE8nkodhI+H+rqtAnkiWXolXPYcnzSx7GLtap/g2eCqkFToe/MkBaETkyA5A3vVZs3 XiE6e3Az7f2+ER9aVsp+4DtCOPykCJDFOZ0NDgWwyuwvPzlY3Fa7ancNYPmHHr9PiOcI VMjy1Y9DfHPzJMNMwAF1dMRWuwbiVzQtkzdf4oHOd1sijs2rjj65rCaPPontEKy3uqCx ZZimjh0lK2sm1wOI2cC1dd6ufbPn7rsjyl5VTVPIXuHUJI0adAhY3hp+l3yptXrCsWMy yAcw== ARC-Authentication-Results: i=1; mx.google.com; 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 o68si6719010pfk.327.2018.01.18.05.18.02; Thu, 18 Jan 2018 05:18:02 -0800 (PST) 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; 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 S1756220AbeARNSA (ORCPT + 28 others); Thu, 18 Jan 2018 08:18:00 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:62519 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755875AbeARNR6 (ORCPT ); Thu, 18 Jan 2018 08:17:58 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lx3gz-1ermCd1WhN-016dcR; Thu, 18 Jan 2018 14:17:50 +0100 From: Arnd Bergmann To: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" Cc: Arnd Bergmann , David Ahern , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [net-next] net: sched: avoid uninitialized variable use Date: Thu, 18 Jan 2018 14:17:28 +0100 Message-Id: <20180118131747.920324-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:e8LR800nSZrNgtKxhVZOQ3YdHhXt6m3fTKMLlrlwWQzxsf9RgHp eiwRczr1XaDRzvlXh0ZR8OkmkpKrvudtYhGCLqgw2zlLM7Y73Mcf92L47av7sTv/zonYOll 1OeojehQ47u0WqDvTzGB82wIj3zl3sUSST1P7Ga516iuNs2kMU+xAJZY4HTzN5lIf4c13m8 WGGR46RZZ/4qoYazaETOQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Q9xPNQ71sr8=:oMbqpnlNIKMYdFpgvY9m15 edahFRVojCtZZ0HRBIKipbqszC2aqpOyfccJsqUqYCjfDv4rb6NrCk70ajNOOiR27UNh6jMME lGkh6g/3ob3+viiXfOUXLKF6VveCFByb4fdoV80awABiAh3juJGA3V6QZANYNa+9STTYMxrVn tae1ZBuspP2BsxcyVIyh2wmM9eTBCcaP8iJahQGaskkkhXV9air4eYCCq9XHDnIRpsn5XdR/q D6LA60sY3y6xSVCpuFQgrpJVepN+6Yio3qdCYwFt0244wbiVSNXJulebJxqgh9N7C79BreEJb u46lLh3vGaaHA+RxvDNXzsbK7H2gF0ejxLKf3litd0FSzRh8aNJh1MDyCA8hoiARKEGT9xMpf 3xgNkYWCdoFLSJvnyXLpwIKUhdIJtOpaF6xTQGOUUYcU4DCeKrlSncojTAU1QiCrzJtoYFkE4 SIPjFgjs2amA8yEk8uQiCx0hONQRDAFxhUk6KEb+8AM99W9YB+SPa4NRb1m3UCkSeugJvxDiq fYyZl6CAd+f7oyo2pBysSKBxQTaeAtioy5Eoyb9qGb0/VcAnmEGdJtXCYkGkYL3WFrOEd2hWt 56CWLJnxa8yao1Il031p6B1bWX8GaaGqjHAcurpWRV2iXoGfGTqYX/VRNFjOKaq1oTQgIG6Bq o29f0mHkabpz4cayjHc+VKKEziRdOlxH4PPNrJtTGa7sif/HCQJLb9tpipieP41DkDDBl3lT8 71+xynEdH3Zt75bSDUuZf6IgcN7n1kaJk49fxA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc has identified a code path in which we pass uninitialized data into tc_dump_tfilter(): net/sched/cls_api.c: In function 'tc_dump_tfilter': net/sched/cls_api.c:1268:8: error: 'parent' may be used uninitialized in this function [-Werror=maybe-uninitialized] This initializes the variable to the value it had before the previous change. Fixes: 7960d1daf278 ("net: sched: use block index as a handle instead of qdisc when block is shared") Signed-off-by: Arnd Bergmann ---- I don't know if my patch is the best way to address the issue, but if not, then at least it helps show what the warning is about and lets someone else come up with a better solution. --- net/sched/cls_api.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index e500d11da9cd..a95bfc8fc442 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -1317,6 +1317,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) block = tcf_block_lookup(net, tcm->tcm_block_index); if (!block) goto out; + parent = tcm->tcm_parent; } else { const struct Qdisc_class_ops *cops; struct net_device *dev;