[PATCH] Revert "drm/ast: Zero is missing in detect function"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Fixes: 572994bf18ff ("drm/ast: Zero is missing in detect function")
Reported-by: Chuck Lever III <chuck.lever@xxxxxxxxxx>
Reported-by: Kim Phillips <kim.phillips@xxxxxxx>
Cc: Ainux.Wang <ainux.wang@xxxxxxxxx>
Cc: Thomas Zimmermann <tzimmermann@xxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Link: https://lore.kernel.org/dri-devel/A194B6CE-AF77-422D-A92F-292ABD83BCCE@xxxxxxxxxx/
---
 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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux