From: David Miller <davem@davemloft.net>
To: chrisw@sous-sol.org
Cc: dhowells@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH] rtnetlink: Fix error handling in do_setlink()
Date: Sun, 23 May 2010 23:12:20 -0700 (PDT) [thread overview]
Message-ID: <20100523.231220.155367105.davem@davemloft.net> (raw)
In-Reply-To: <20100522065212.GW8301@sequoia.sous-sol.org>
From: Chris Wright <chrisw@sous-sol.org>
Date: Fri, 21 May 2010 23:52:12 -0700
> * David Howells (dhowells@redhat.com) wrote:
>> Commit c02db8c6290bb992442fec1407643c94cc414375:
>>
>> Author: Chris Wright <chrisw@sous-sol.org>
>> Date: Sun May 16 01:05:45 2010 -0700
>> Subject: rtnetlink: make SR-IOV VF interface symmetric
>>
>> adds broken error handling to do_setlink() in net/core/rtnetlink.c. The
>> problem is the following chunk of code:
>>
>> if (tb[IFLA_VFINFO_LIST]) {
>> struct nlattr *attr;
>> int rem;
>> nla_for_each_nested(attr, tb[IFLA_VFINFO_LIST], rem) {
>> if (nla_type(attr) != IFLA_VF_INFO)
>> ----> goto errout;
>> err = do_setvfinfo(dev, attr);
>> if (err < 0)
>> goto errout;
>> modified = 1;
>> }
>> }
>>
>> which can get to errout without setting err, resulting in the following error:
>>
>> net/core/rtnetlink.c: In function 'do_setlink':
>> net/core/rtnetlink.c:904: warning: 'err' may be used uninitialized in this function
>>
>> Change the code to return -EINVAL in this case. Note that this might not be
>> the appropriate error though.
>>
>> Signed-off-by: David Howells <dhowells@redhat.com>
>
> Acked-by: Chris Wright <chrisw@sous-sol.org>
Applied, thanks.
prev parent reply other threads:[~2010-05-24 6:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-21 12:25 [PATCH] rtnetlink: Fix error handling in do_setlink() David Howells
2010-05-22 6:52 ` Chris Wright
2010-05-24 6:12 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100523.231220.155367105.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=chrisw@sous-sol.org \
--cc=dhowells@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).