]> git.baikalelectronics.ru Git - kernel.git/commit
drm/self_refresh: Fix possible NULL deref in failure path
authorSean Paul <seanpaul@chromium.org>
Wed, 19 Jun 2019 18:19:47 +0000 (14:19 -0400)
committerSean Paul <seanpaul@chromium.org>
Thu, 20 Jun 2019 14:03:21 +0000 (10:03 -0400)
commit37d19d447c115cde971628f5af88558d6d87bab1
tree76e033a4c13b48524f47b27733e581fc952ed73a
parent2878d6c53461f7bb3bcd0e0d017301044f8eab71
drm/self_refresh: Fix possible NULL deref in failure path

If state allocation fails, we still try to give back the reference on
it. Also initialize ret in case the crtc is not enabled and we hit the
eject button.

Fixes: 5984c6becf2a ("drm: Add helpers to kick off self refresh mode in drivers")
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jose Souza <jose.souza@intel.com>
Cc: Zain Wang <wzz@rock-chips.com>
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190619181951.192305-1-sean@poorly.run
drivers/gpu/drm/drm_self_refresh_helper.c