From: Ville Syrjälä Date: Fri, 7 Feb 2020 15:22:28 +0000 (+0200) Subject: drm/i915: Don't use uninitialized 'ret' X-Git-Tag: baikal/mips/sdk5.9~13997^2~18^2~93 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=0525637e98bed33f0401da1f09502d331a2e4230;p=kernel.git drm/i915: Don't use uninitialized 'ret' Accidentally removed the 'ret=0' initialization, and thus we're potentially looking at some stack garbage here. The whole 'ret = do_stuff; if (!ret) do_other_stuff;' pattern confuses my brain so let's replace it with the standard immediate return thing. Reported-by: Chris Wilson Fixes: 2f81cdcd2a21 ("drm/i915: Convert cdclk to global state") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200207152228.1054-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson --- diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 80eebdc4c6702..61ba1f2256a03 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -12843,11 +12843,13 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state, } if (INTEL_GEN(dev_priv) >= 9) { - if (mode_changed || crtc_state->update_pipe) + if (mode_changed || crtc_state->update_pipe) { ret = skl_update_scaler_crtc(crtc_state); - if (!ret) - ret = intel_atomic_setup_scalers(dev_priv, crtc, - crtc_state); + if (ret) + return ret; + } + + ret = intel_atomic_setup_scalers(dev_priv, crtc, crtc_state); if (ret) return ret; }