Thread (5 messages) flat view 5 messages, 2 authors, 8d ago
COOLING8d

[PATCH v1 1/2] Revert "usb: typec: ucsi: displayport: Fix OOB altmode array index"

From: Jameson Thies <jthies@google.com>
Date: 2026-09-10 23:36:04
Also in: lkml
Subsystem: the rest, usb subsystem, usb typec class · Maintainers: Linus Torvalds, Greg Kroah-Hartman, Heikki Krogerus

This reverts commit 04cec690b1fd9d1c4c314b91a10d8c68a3acfe18.

Signed-off-by: Jameson Thies <jthies@google.com>
---
 drivers/usb/typec/ucsi/displayport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/ucsi/displayport.c b/drivers/usb/typec/ucsi/displayport.c
index 8d2032d0762c..7067f2561b84 100644
--- a/drivers/usb/typec/ucsi/displayport.c
+++ b/drivers/usb/typec/ucsi/displayport.c
@@ -74,7 +74,7 @@ static int ucsi_displayport_enter(struct typec_altmode *alt, u32 *vdo)
 		cur = 0xff;
 	}
 
-	if (cur < UCSI_MAX_ALTMODES) {
+	if (cur != 0xff) {
 		ret = dp->con->port_altmode[cur] == alt ? 0 : -EBUSY;
 		goto err_unlock;
 	}
-- 
2.55.0.1007.g17ff1f9808-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help