dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, daniel@ffwll.ch, ainux.wang@gmail.com
Cc: dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Chuck Lever III <chuck.lever@oracle.com>,
	Kim Phillips <kim.phillips@amd.com>
Subject: [PATCH] Revert "drm/ast: Zero is missing in detect function"
Date: Fri, 15 Oct 2021 09:25:46 +0200	[thread overview]
Message-ID: <20211015072546.3705-1-tzimmermann@suse.de> (raw)

Commit 572994bf18ff ("drm/ast: Zero is missing in detect function")
prevents some systems from booting. Seen on Supermicro Super
Server/X10SRL-F, BIOS 3.3 10/28/2020 . There's further a bug that
results in

  KASAN: use-after-free in enqueue_timer+0x4f/0x1e0

which is also triggered by commit
572994bf18ff ("drm/ast: Zero is missing in detect function").

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 572994bf18ff ("drm/ast: Zero is missing in detect function")
Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Reported-by: Kim Phillips <kim.phillips@amd.com>
Cc: Ainux.Wang <ainux.wang@gmail.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Link: https://lore.kernel.org/dri-devel/A194B6CE-AF77-422D-A92F-292ABD83BCCE@oracle.com/
---
 drivers/gpu/drm/ast/ast_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 6bfaefa01818..ea64944ad4ca 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -1306,7 +1306,7 @@ static enum drm_connector_status ast_connector_detect(struct drm_connector
 	int r;
 
 	r = ast_get_modes(connector);
-	if (r <= 0)
+	if (r < 0)
 		return connector_status_disconnected;
 
 	return connector_status_connected;
-- 
2.33.0


             reply	other threads:[~2021-10-15  7:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  7:25 Thomas Zimmermann [this message]
2021-10-15 19:27 ` [PATCH] Revert "drm/ast: Zero is missing in detect function" Kim Phillips

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=20211015072546.3705-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=ainux.wang@gmail.com \
    --cc=airlied@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kim.phillips@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox