]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: Fix implicit cast from le16
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 22 Jul 2025 11:47:05 +0000 (12:47 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 22 Jul 2025 14:34:08 +0000 (15:34 +0100)
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>
Link: https://patch.msgid.link/20250722114705.2816910-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_hid.c

index 2224ade59affa433e18b846fb36730008d083559..967f7ec6fb79de6165a9c9ae84a84b7a00e120b2 100644 (file)
@@ -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);