All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: lichun <lichun@ruijie.com.cn>,
	QEMU Developers <qemu-devel@nongnu.org>,
	706701795@qq.com
Subject: Re: [PATCH] console: avoid passing con=NULL to graphic_hw_update_done() In graphic_hw_update(), first select an existing console, a specific-console or active_console(if not specified), then updating the console.
Date: Sat, 7 Nov 2020 10:36:13 +0000	[thread overview]
Message-ID: <CAFEAcA_ZE6RwjScbvBe4nrO+QdfLWnfNzycAb9vGcnoQBTbuFA@mail.gmail.com> (raw)
In-Reply-To: <20201106092848.yqoajggs2pdqbhjm@sirius.home.kraxel.org>

On Fri, 6 Nov 2020 at 09:28, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
>   Hi,
>
> If you have an long commit message put it into the body not the subject
> please.
>
> On Sat, Nov 07, 2020 at 01:03:39AM +0800, lichun wrote:
> > Signed-off-by: lichun <lichun@ruijie.com.cn>
> > ---
> >  ui/console.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/ui/console.c b/ui/console.c
> > index e8e5970..e07d2c3 100644
> > --- a/ui/console.c
> > +++ b/ui/console.c
> > @@ -270,10 +270,11 @@ void graphic_hw_update_done(QemuConsole *con)
> >  void graphic_hw_update(QemuConsole *con)
> >  {
> >      bool async = false;
> > +    con = con ? con : active_console;
>
> con should not be NULL at this point.

There is definitely a bug in the code currently in master, though.
Coverity points out (CID 1436158) that it checks for con being
NULL in the "if (con && con->hw_ops->gfx_update) {" line, but
then proceeds to call "graphic_hw_update_done(con);" which
assumes con is non-NULL. If con can't be NULL then the check
in the if() is unnecessary.

thnask
-- PMM


      parent reply	other threads:[~2020-11-07 10:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 17:03 [PATCH] console: avoid passing con=NULL to graphic_hw_update_done() In graphic_hw_update(), first select an existing console, a specific-console or active_console(if not specified), then updating the console lichun
2020-11-06  9:28 ` Gerd Hoffmann
2020-11-06  9:35   ` lichun
2020-11-07 10:36   ` Peter Maydell [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=CAFEAcA_ZE6RwjScbvBe4nrO+QdfLWnfNzycAb9vGcnoQBTbuFA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=706701795@qq.com \
    --cc=kraxel@redhat.com \
    --cc=lichun@ruijie.com.cn \
    --cc=qemu-devel@nongnu.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 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.