lkml.org 
[lkml]   [2018]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] [net-next] net: sched: avoid uninitialized variable use
On Thu, Jan 18, 2018 at 2:49 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> Thu, Jan 18, 2018 at 02:17:28PM CET, arnd@arndb.de wrote:
>>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 <arnd@arndb.de>
>>----
>>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.
>
> I already sent a fix for this:
> http://patchwork.ozlabs.org/patch/862787/

Ok. I've looked at your patch for way too long now and still don't see how
you've shown it to be correct. Shouldn't there be a at least a comment
to explain why zero is an appropriate initialization value in that case?

Arnd

\
 
 \ /
  Last update: 2018-01-18 15:19    [W:0.142 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site