diff mbox series

drm/gud: Fix descriptor magic check

Message ID 20211124201438.27562-1-noralf@tronnes.org (mailing list archive)
State New, archived
Headers show
Series drm/gud: Fix descriptor magic check | expand

Commit Message

Noralf Trønnes Nov. 24, 2021, 8:14 p.m. UTC
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")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/gud/gud_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
index 3f9d4b9a1e3d..e6db478f1e49 100644
--- a/drivers/gpu/drm/gud/gud_drv.c
+++ b/drivers/gpu/drm/gud/gud_drv.c
@@ -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,