> -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of David Miller > Sent: Wednesday, November 15, 2017 1:08 PM > To: [email protected] > Cc: [email protected]; Yuan, Linyu (NSB - CN/Shanghai) > Subject: Re: [PATCH net-next] net: assign err to 0 at begin in do_setlink() > function > > From: yuan linyu <[email protected]> > Date: Tue, 14 Nov 2017 22:30:59 +0800 > > > From: yuan linyu <[email protected]> > > > > each netlink attribute have proper process when error happen, > > when exit on attribute process, it implies that no error, > > so err = 0; is useless. > > > > assign err = 0; at beginning if all attributes not set. > > > > Signed-off-by: yuan linyu <[email protected]> > > This change is not correct. > > The IFLA_VF_PORTS code block can finish with err set non-zero.
Do you mean this block can return err = -EOPNOTSUPP; ? It means nla_for_each_nested() in this block will never enter, right ? > The assignment to zero there is really necessary.
