All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: "Noralf Trønnes" <noralf@tronnes.org>,
	peter@stuge.se, "kernel test robot" <lkp@intel.com>
Subject: [PATCH] drm/gud: Fix descriptor magic check
Date: Wed, 24 Nov 2021 21:14:38 +0100	[thread overview]
Message-ID: <20211124201438.27562-1-noralf@tronnes.org> (raw)

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 --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,
-- 
2.33.0


                 reply	other threads:[~2021-11-24 20:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211124201438.27562-1-noralf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lkp@intel.com \
    --cc=peter@stuge.se \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.