All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SDCA: Fix implicit cast from le16
@ 2025-07-22 11:47 Charles Keepax
  2025-07-22 16:06 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2025-07-22 11:47 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
	shumingf, linux-sound, patches

As the HID wDescriptorLength is explicitly marked as little endian it
should be converted to host endian before being used.

Fixes: ac558015dfd8 ("ASoC: SDCA: add a HID device for HIDE entity")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507221024.M18hWD6q-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/sdca/sdca_hid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sdca/sdca_hid.c b/sound/soc/sdca/sdca_hid.c
index 2224ade59aff..967f7ec6fb79 100644
--- a/sound/soc/sdca/sdca_hid.c
+++ b/sound/soc/sdca/sdca_hid.c
@@ -24,7 +24,7 @@ static int sdwhid_parse(struct hid_device *hid)
 	unsigned int rsize;
 	int ret;
 
-	rsize = entity->hide.hid_desc.rpt_desc.wDescriptorLength;
+	rsize = le16_to_cpu(entity->hide.hid_desc.rpt_desc.wDescriptorLength);
 
 	if (!rsize || rsize > HID_MAX_DESCRIPTOR_SIZE) {
 		dev_err(&hid->dev, "invalid size of report descriptor (%u)\n", rsize);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-22 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 11:47 [PATCH] ASoC: SDCA: Fix implicit cast from le16 Charles Keepax
2025-07-22 16:06 ` Mark Brown

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.