All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
	David Airlie <airlied@linux.ie>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm: self_refresh: Fix a reversed condition in drm_self_refresh_helper_cleanup()
Date: Wed, 19 Jun 2019 10:01:41 +0000	[thread overview]
Message-ID: <20190619100141.GA28596@mwanda> (raw)

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>
---
I'm not totally sure what the prefered patch prefix for this code.  One
thing that would help is when we're adding new files we should specify
the prefix that they're going to use:

- drm: Add helpers to kick off self refresh mode in drivers
+ drm: refresh mode: Add helpers to kick off self refresh mode in drivers

It's a small thing and email always sounds whiny but I'm sending this
suggestion to everyone today so...

 drivers/gpu/drm/drm_self_refresh_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.20.1

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
	David Airlie <airlied@linux.ie>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm: self_refresh: Fix a reversed condition in drm_self_refresh_helper_cleanup()
Date: Wed, 19 Jun 2019 13:01:41 +0300	[thread overview]
Message-ID: <20190619100141.GA28596@mwanda> (raw)

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>
---
I'm not totally sure what the prefered patch prefix for this code.  One
thing that would help is when we're adding new files we should specify
the prefix that they're going to use:

- drm: Add helpers to kick off self refresh mode in drivers
+ drm: refresh mode: Add helpers to kick off self refresh mode in drivers

It's a small thing and email always sounds whiny but I'm sending this
suggestion to everyone today so...

 drivers/gpu/drm/drm_self_refresh_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-06-19 10:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 10:01 Dan Carpenter [this message]
2019-06-19 10:01 ` [PATCH] drm: self_refresh: Fix a reversed condition in drm_self_refresh_helper_cleanup() Dan Carpenter
2019-06-19 15:03 ` Sean Paul
2019-06-19 15:03   ` Sean Paul
2019-06-19 15:34   ` Jani Nikula
2019-06-19 15:34     ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619100141.GA28596@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.