Skip to contentSkip to conversation

drm/gud: Fix descriptor magic check

PATCH New Noralf Trønnes 1 participant 1 message Nov 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/gud: Fix descriptor magic check

le32_to_cpu() was put around the wrong operand in the descriptor magic value check. Fix this and put it around the descriptor value which is the one that is in little endian format.

Fixes 40e1a70 ("drm: Add GUD USB Display driver")
---
 drivers/gpu/drm/gud/gud_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/gud/gud_drv.c +1 -1
index 3f9d4b9a1e3d..e6db478f1e49 100644
@@ -92,7 +92,7 @@ static int gud_get_display_descriptor(struct usb_interface *intf,
 	if (ret != sizeof(*desc))
 		return -EIO;
 
-	if (desc->magic != le32_to_cpu(GUD_DISPLAY_MAGIC))
+	if (le32_to_cpu(desc->magic) != GUD_DISPLAY_MAGIC)
 		return -ENODATA;
 
 	DRM_DEV_DEBUG_DRIVER(&intf->dev,
Signature · 1 line
2.33.0