lkml.org 
[lkml]   [2022]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ipvs: initialize 'ret' variable in do_ip_vs_set_ctl()
From
Date


在 2022年12月02日 18:07, Dan Carpenter 写道:
> On Fri, Dec 02, 2022 at 11:25:11AM +0800, Li Qiong wrote:
>> The 'ret' should need to be initialized to 0, in case
>> return a uninitialized value because no default process
>> for "switch (cmd)".
>>
>> Signed-off-by: Li Qiong <liqiong@nfschina.com>
> If this is a real bug, then it needs a fixes tag. The fixes tag helps
> us know whether to back port or not and it also helps in reviewing the
> patch. Also get_maintainer.pl will CC the person who introduced the
> bug so they can review it. They are normally the best person to review
> their own code.
>
> Here it would be:
> Fixes: c5a8a8498eed ("ipvs: Fix uninit-value in do_ip_vs_set_ctl()")
>
> Which is strange... Also it suggest that the correct value is -EINVAL
> and not 0.
>
> The thing about uninitialized variable bugs is that Smatch and Clang
> both warn about them so they tend to get reported pretty quick.
> Apparently neither Nathan nor I sent forwarded this static checker
> warning. :/
>
> regards,
> dan carpenter

It is not a real bug, I use tool (eg: smatch, sparse) to audit the code, got this warning and check it,
found may be a real problem.

\
 
 \ /
  Last update: 2022-12-02 11:22    [W:0.634 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site