lkml.org 
[lkml]   [2022]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] net: rtnetlink: fix error handling in rtnl_fill_statsinfo()
Date

trix@redhat.com writes:

> From: Tom Rix <trix@redhat.com>
>
> The clang static analyzer reports this issue
> rtnetlink.c:5481:2: warning: Undefined or garbage
> value returned to caller
> return err;
> ^~~~~~~~~~
>
> There is a function level err variable, in the
> list_for_each_entry_rcu block there is a shadow
> err. Remove the shadow.
>
> In the same block, the call to nla_nest_start_noflag()
> can fail without setting an err. Set the err
> to -EMSGSIZE.
>
> Fixes: 216e690631f5 ("net: rtnetlink: rtnl_fill_statsinfo(): Permit non-EMSGSIZE error returns")
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Petr Machata <petrm@nvidia.com>

Thanks!

\
 
 \ /
  Last update: 2022-03-07 11:13    [W:0.037 / U:3.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site