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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMavQKLRm8uYu3O=co5Ui7YjkK0hKHAd=+TA0oExfqnLc+TLFA@mail.gmail.com>
Date:   Mon, 10 Jun 2019 16:50:50 -0400
From:   Sean Paul <sean@...rly.run>
To:     Douglas Anderson <dianders@...omium.org>
Cc:     Sean Paul <seanpaul@...omium.org>,
        "open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
        Erico Nunes <nunes.erico@...il.com>,
        Heiko Stuebner <heiko@...ech.de>,
        David Airlie <airlied@...ux.ie>,
        Andrzej Hajda <a.hajda@...sung.com>,
        Jonas Karlman <jonas@...boo.se>,
        LKML <linux-kernel@...r.kernel.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Sam Ravnborg <sam@...nborg.org>,
        Neil Armstrong <narmstrong@...libre.com>,
        Ville Syrjälä <ville.syrjala@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Daniel Vetter <daniel@...ll.ch>
Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: Fix unwedge crash when no
 pinctrl entries

On Mon, Jun 10, 2019 at 1:52 PM Douglas Anderson <dianders@...omium.org> wrote:
>
> In commit 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge"
> for ddc bus") I stupidly used IS_ERR() to check for whether we have an
> "unwedge" pinctrl state even though on most flows through the driver
> the unwedge state will just be NULL.
>
> Fix it so that we consistently use NULL for no unwedge state.
>
> Fixes: 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge" for ddc bus")
> Reported-by: Erico Nunes <nunes.erico@...il.com>
> Signed-off-by: Douglas Anderson <dianders@...omium.org>

Thanks Erico for the report, and Doug for fixing this up quickly, I've applied
the patch to drm-misc-next

Sean

> ---
>
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index f25e091b93c5..5e4e9408d00f 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -251,7 +251,7 @@ static void dw_hdmi_i2c_init(struct dw_hdmi *hdmi)
>  static bool dw_hdmi_i2c_unwedge(struct dw_hdmi *hdmi)
>  {
>         /* If no unwedge state then give up */
> -       if (IS_ERR(hdmi->unwedge_state))
> +       if (!hdmi->unwedge_state)
>                 return false;
>
>         dev_info(hdmi->dev, "Attempting to unwedge stuck i2c bus\n");
> @@ -2686,11 +2686,13 @@ __dw_hdmi_probe(struct platform_device *pdev,
>                         hdmi->default_state =
>                                 pinctrl_lookup_state(hdmi->pinctrl, "default");
>
> -                       if (IS_ERR(hdmi->default_state) &&
> -                           !IS_ERR(hdmi->unwedge_state)) {
> -                               dev_warn(dev,
> -                                        "Unwedge requires default pinctrl\n");
> -                               hdmi->unwedge_state = ERR_PTR(-ENODEV);
> +                       if (IS_ERR(hdmi->default_state) ||
> +                           IS_ERR(hdmi->unwedge_state)) {
> +                               if (!IS_ERR(hdmi->unwedge_state))
> +                                       dev_warn(dev,
> +                                                "Unwedge requires default pinctrl\n");
> +                               hdmi->default_state = NULL;
> +                               hdmi->unwedge_state = NULL;
>                         }
>                 }
>
> --
> 2.22.0.rc2.383.gf4fbbf30c2-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ