Skip to content

Commit 246570c

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: SDCA: Fix implicit cast from le16
As the HID wDescriptorLength is explicitly marked as little endian it should be converted to host endian before being used. Fixes: ac55801 ("ASoC: SDCA: add a HID device for HIDE entity") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Charles Keepax <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 59c5dbd commit 246570c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sdca/sdca_hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static int sdwhid_parse(struct hid_device *hid)
2424
unsigned int rsize;
2525
int ret;
2626

27-
rsize = entity->hide.hid_desc.rpt_desc.wDescriptorLength;
27+
rsize = le16_to_cpu(entity->hide.hid_desc.rpt_desc.wDescriptorLength);
2828

2929
if (!rsize || rsize > HID_MAX_DESCRIPTOR_SIZE) {
3030
dev_err(&hid->dev, "invalid size of report descriptor (%u)\n", rsize);

0 commit comments

Comments
 (0)