lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu,  7 Apr 2022 09:15:19 +0800
From:   Xiaomeng Tong <xiam0nd.tong@...il.com>
To:     patrik.r.jakobsson@...il.com
Cc:     airlied@...ux.ie, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, xiam0nd.tong@...il.com
Subject: Re: [PATCH] drm/gma500: fix a missing break in psb_driver_load

On Wed, 6 Apr 2022 09:27:19 +0200, Patrik Jakobsson wrote:
> On Fri, Apr 1, 2022 at 1:58 PM Xiaomeng Tong <xiam0nd.tong@...il.com> wrote:
> >
> > Instead of exiting the loop as expected when an entry is found, the
> > list_for_each_entry() continues until the traversal is complete. To
> > avoid potential executing 'ret = gma_backlight_init(dev);' repeatly,
> > break the loop when the entry is found.
> >
> > Signed-off-by: Xiaomeng Tong <xiam0nd.tong@...il.com>
> > ---
> >  drivers/gpu/drm/gma500/psb_drv.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> > index 2aff54d505e2..b61a8b0eea38 100644
> > --- a/drivers/gpu/drm/gma500/psb_drv.c
> > +++ b/drivers/gpu/drm/gma500/psb_drv.c
> > @@ -402,6 +402,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
> >                         ret = gma_backlight_init(dev);
> >                         break;
> >                 }
> > +
> > +               if (!ret)
> > +                       break;
> 
> Hi,
> We cannot do it like this either. If the first connector isn't LVDS or
> MIPI we would just break out of the iteration because ret is
> presumably 0 at start and gma_backlight_init() would never run.
> 
> -Patrik

Yes, you are correct. I have sent a v2 patch[1]: just goto out; when found.
Please check it, thank you very much.

[1]: https://lore.kernel.org/all/20220406113143.10699-1-xiam0nd.tong@gmail.com/

--
Xiaomeng Tong
 
> 
> >         }
> >         drm_connector_list_iter_end(&conn_iter);
> >
> > --
> > 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ