From: Luiz Capitulino <lcapitulino@redhat.com>
To: arei.gonglei@huawei.com
Cc: kwolf@redhat.com, ChenLiang <chenliang88@huawei.com>,
peter.crosthwaite@xilinx.com, weidong.huang@huawei.com,
aliguori@amazon.com, mst@redhat.com, luonengjun@huawei.com,
qemu-devel@nongnu.org, armbru@redhat.com,
qiaonuohan@cn.fujitsu.com, av1474@comtv.ru, kraxel@redhat.com,
stefanha@redhat.com, crobinso@redhat.com, pbonzini@redhat.com,
lersek@redhat.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v2 3/6] json-parser: Fix two coverity defects
Date: Mon, 9 Jun 2014 16:15:48 -0400 [thread overview]
Message-ID: <20140609161548.2cc1829e@redhat.com> (raw)
In-Reply-To: <1401283300-14176-4-git-send-email-arei.gonglei@huawei.com>
On Wed, 28 May 2014 21:21:37 +0800
<arei.gonglei@huawei.com> wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> Pointer "token" returned by "parser_context_pop_token(ctxt)" is never used.
That's not true, "token" is used by token_is_operator(). The patch seems
correct to me, but you have to fix the changelog.
Also, who's going to take care of this series? I'm willing to cherry-pick
this patch...
>
> Signed-off-by: ChenLiang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
> qobject/json-parser.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/qobject/json-parser.c b/qobject/json-parser.c
> index e46c264..4288267 100644
> --- a/qobject/json-parser.c
> +++ b/qobject/json-parser.c
> @@ -423,7 +423,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
> if (!token_is_operator(token, '{')) {
> goto out;
> }
> - token = NULL;
>
> dict = qdict_new();
>
> @@ -449,7 +448,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
> parse_error(ctxt, token, "expected separator in dict");
> goto out;
> }
> - token = NULL;
>
> if (parse_pair(ctxt, dict, ap) == -1) {
> goto out;
> @@ -461,10 +459,8 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
> goto out;
> }
> }
> - token = NULL;
> } else {
> - token = parser_context_pop_token(ctxt);
> - token = NULL;
> + (void)parser_context_pop_token(ctxt);
> }
>
> return QOBJECT(dict);
> @@ -487,10 +483,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
> }
>
> if (!token_is_operator(token, '[')) {
> - token = NULL;
> goto out;
> }
> - token = NULL;
>
> list = qlist_new();
>
> @@ -523,8 +517,6 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
> goto out;
> }
>
> - token = NULL;
> -
> obj = parse_value(ctxt, ap);
> if (obj == NULL) {
> parse_error(ctxt, token, "expecting value");
> @@ -539,11 +531,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
> goto out;
> }
> }
> -
> - token = NULL;
> } else {
> - token = parser_context_pop_token(ctxt);
> - token = NULL;
> + (void)parser_context_pop_token(ctxt);
> }
>
> return QOBJECT(list);
next prev parent reply other threads:[~2014-06-09 20:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1401283300-14176-1-git-send-email-arei.gonglei@huawei.com>
[not found] ` <1401283300-14176-6-git-send-email-arei.gonglei@huawei.com>
2014-06-04 8:15 ` [Qemu-devel] [PATCH v2 5/6] qemu-bridge-helper: Fix fd leak in main() Stefan Hajnoczi
[not found] ` <1401283300-14176-4-git-send-email-arei.gonglei@huawei.com>
2014-06-09 20:15 ` Luiz Capitulino [this message]
2014-06-10 6:51 ` [Qemu-devel] [PATCH v2 3/6] json-parser: Fix two coverity defects Gonglei (Arei)
[not found] ` <1401283300-14176-3-git-send-email-arei.gonglei@huawei.com>
2014-06-10 8:38 ` [Qemu-devel] [PATCH v2 2/6] vga: Fix divide-by-zero in vga_update_text Gonglei (Arei)
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=20140609161548.2cc1829e@redhat.com \
--to=lcapitulino@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=av1474@comtv.ru \
--cc=chenliang88@huawei.com \
--cc=crobinso@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lersek@redhat.com \
--cc=luonengjun@huawei.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=qemu-devel@nongnu.org \
--cc=qiaonuohan@cn.fujitsu.com \
--cc=stefanha@redhat.com \
--cc=weidong.huang@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.