diff mbox series

[1/1] ui: Replacing pointer in function

Message ID 20231012104448.1251039-1-mironov@fintech.ru
State New
Headers show
Series [1/1] ui: Replacing pointer in function | expand

Commit Message

At the end of the first if we see 'vc->gfx.surface = NULL;',
further checking of it is pointless. In the second if, ectx is taken.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Co-developed-by: Linux Verification Center <sdl.qemu@linuxtesting.org>
Signed-off-by: Sergey Mironov <mironov@fintech.ru>
---
 ui/gtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marc-André Lureau Oct. 16, 2023, 12:23 p.m. UTC | #1
On Thu, Oct 12, 2023 at 2:46 PM Sergey Mironov <mironov@fintech.ru> wrote:
>
> At the end of the first if we see 'vc->gfx.surface = NULL;',
> further checking of it is pointless. In the second if, ectx is taken.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Co-developed-by: Linux Verification Center <sdl.qemu@linuxtesting.org>
> Signed-off-by: Sergey Mironov <mironov@fintech.ru>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  ui/gtk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 935de1209b..5da3f9b022 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -1400,7 +1400,7 @@ static void gd_menu_untabify(GtkMenuItem *item, void *opaque)
>              eglDestroySurface(qemu_egl_display, vc->gfx.esurface);
>              vc->gfx.esurface = NULL;
>          }
> -        if (vc->gfx.esurface) {
> +        if (vc->gfx.ectx) {
>              eglDestroyContext(qemu_egl_display, vc->gfx.ectx);
>              vc->gfx.ectx = NULL;
>          }
> --
> 2.31.1
>
Hello! Is there any progress on this patch?
Marc-André Lureau Oct. 25, 2023, 7:53 a.m. UTC | #3
Hi

On Wed, Oct 25, 2023 at 11:42 AM Миронов Сергей Владимирович
<mironov@fintech.ru> wrote:
>
> Hello! Is there any progress on this patch?

I queued it, waiting for the freeze (in 2w) to focus on bug fixes.

thanks

>
> ________________________________
> От: Marc-André Lureau <marcandre.lureau@redhat.com>
> Отправлено: 16 октября 2023 г. 15:23:42
> Кому: Миронов Сергей Владимирович
> Копия: kraxel@redhat.com; qemu-devel@nongnu.org; Linux Verification Center
> Тема: Re: [PATCH 1/1] ui: Replacing pointer in function
>
> On Thu, Oct 12, 2023 at 2:46 PM Sergey Mironov <mironov@fintech.ru> wrote:
> >
> > At the end of the first if we see 'vc->gfx.surface = NULL;',
> > further checking of it is pointless. In the second if, ectx is taken.
> >
> > Found by Linux Verification Center (linuxtesting.org) with SVACE.
> >
> > Co-developed-by: Linux Verification Center <sdl.qemu@linuxtesting.org>
> > Signed-off-by: Sergey Mironov <mironov@fintech.ru>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> > ---
> >  ui/gtk.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ui/gtk.c b/ui/gtk.c
> > index 935de1209b..5da3f9b022 100644
> > --- a/ui/gtk.c
> > +++ b/ui/gtk.c
> > @@ -1400,7 +1400,7 @@ static void gd_menu_untabify(GtkMenuItem *item, void *opaque)
> >              eglDestroySurface(qemu_egl_display, vc->gfx.esurface);
> >              vc->gfx.esurface = NULL;
> >          }
> > -        if (vc->gfx.esurface) {
> > +        if (vc->gfx.ectx) {
> >              eglDestroyContext(qemu_egl_display, vc->gfx.ectx);
> >              vc->gfx.ectx = NULL;
> >          }
> > --
> > 2.31.1
> >
>
diff mbox series

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index 935de1209b..5da3f9b022 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1400,7 +1400,7 @@  static void gd_menu_untabify(GtkMenuItem *item, void *opaque)
             eglDestroySurface(qemu_egl_display, vc->gfx.esurface);
             vc->gfx.esurface = NULL;
         }
-        if (vc->gfx.esurface) {
+        if (vc->gfx.ectx) {
             eglDestroyContext(qemu_egl_display, vc->gfx.ectx);
             vc->gfx.ectx = NULL;
         }