lkml.org 
[lkml]   [2022]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: rtnetlink: fix error handling in rtnl_fill_statsinfo()
On Sat, Mar 05, 2022 at 10:13:46AM -0800, trix@redhat.com wrote:
> 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>

For net-next:

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

Thanks

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