diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-06-19 13:01:41 +0300 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2019-06-19 09:57:16 -0400 |
commit | 7d0ed30433aa88c94411b6c078a7985a6e7c889f (patch) | |
tree | 90487aeac169fee23868ebb781fe00733d646440 /drivers/gpu | |
parent | 90b86fcc47b4d186f92cd66393fe51871615b4cc (diff) |
drm: self_refresh: Fix a reversed condition in drm_self_refresh_helper_cleanup()
This test is flipped around so it either leads to a memory leak or a
NULL dereference.
Fixes: 1452c25b0e60 ("drm: Add helpers to kick off self refresh mode in drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190619100141.GA28596@mwanda
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_self_refresh_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c index 2b3daaf77841..e0d2ad1f070c 100644 --- a/drivers/gpu/drm/drm_self_refresh_helper.c +++ b/drivers/gpu/drm/drm_self_refresh_helper.c @@ -205,7 +205,7 @@ void drm_self_refresh_helper_cleanup(struct drm_crtc *crtc) struct drm_self_refresh_data *sr_data = crtc->self_refresh_data; /* Helper is already uninitialized */ - if (sr_data) + if (!sr_data) return; crtc->self_refresh_data = NULL; |