From: Jiri Pirko Subject: [patch net-next] net: sched: silence uninitialized parent variable warning in tc_dump_tfilter Date: Thu, 18 Jan 2018 09:05:55 +0100 Message-ID: <20180118080555.1627-1-jiri@resnulli.us> Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, sfr@canb.auug.org.au To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:35978 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753332AbeARIF5 (ORCPT ); Thu, 18 Jan 2018 03:05:57 -0500 Received: by mail-wm0-f66.google.com with SMTP id f3so20893520wmc.1 for ; Thu, 18 Jan 2018 00:05:56 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko When tcm->tcm_ifindex == TCM_IFINDEX_MAGIC_BLOCK, parent is still passed down but the value is never used. Compiler does not recognize it and issues a warning. Silence it down initializing parent to 0. Reported-by: David Miller Reported-by: Stephen Rothwell Signed-off-by: Jiri Pirko --- net/sched/cls_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index e500d11da9cd..9683f8550f6f 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -1303,7 +1303,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) struct tcmsg *tcm = nlmsg_data(cb->nlh); long index_start; long index; - u32 parent; + u32 parent = 0; int err; if (nlmsg_len(cb->nlh) < sizeof(*tcm)) -- 2.14.3