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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMeQTsbQP+hsVtPRJdehwS3yULP0Mif1T8e9G18mJp7dpH77Lg@mail.gmail.com>
Date:   Wed, 19 Aug 2020 15:41:08 +0200
From:   Patrik Jakobsson <patrik.r.jakobsson@...il.com>
To:     trix@...hat.com
Cc:     David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
        Dave Airlie <airlied@...hat.com>, yakui.zhao@...el.com,
        Alan Cox <alan@...ux.intel.com>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/gma500: fix error check

On Wed, Aug 5, 2020 at 10:59 PM <trix@...hat.com> wrote:
>
> From: Tom Rix <trix@...hat.com>
>
> Reviewing this block of code in cdv_intel_dp_init()
>
> ret = cdv_intel_dp_aux_native_read(gma_encoder, DP_DPCD_REV, ...
>
> cdv_intel_edp_panel_vdd_off(gma_encoder);
> if (ret == 0) {
>         /* if this fails, presume the device is a ghost */
>         DRM_INFO("failed to retrieve link info, disabling eDP\n");
>         drm_encoder_cleanup(encoder);
>         cdv_intel_dp_destroy(connector);
>         goto err_priv;
> } else {
>
> The (ret == 0) is not strict enough.
> cdv_intel_dp_aux_native_read() returns > 0 on success
> otherwise it is failure.
>
> So change to <=

Thanks for the patch. Looks correct.

Will apply to drm-misc-next

-Patrik

>
> Fixes: d112a8163f83 ("gma500/cdv: Add eDP support")
>
> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
>  drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index f41cbb753bb4..720a767118c9 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -2078,7 +2078,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
>                                                intel_dp->dpcd,
>                                                sizeof(intel_dp->dpcd));
>                 cdv_intel_edp_panel_vdd_off(gma_encoder);
> -               if (ret == 0) {
> +               if (ret <= 0) {
>                         /* if this fails, presume the device is a ghost */
>                         DRM_INFO("failed to retrieve link info, disabling eDP\n");
>                         drm_encoder_cleanup(encoder);
> --
> 2.18.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ