Patch "usb: gadget: f_hid: fix endianness issue with descriptors" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: gadget: f_hid: fix endianness issue with descriptors

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-gadget-f_hid-fix-endianness-issue-with-descripto.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0a7b95b24e3be1f31fd3bd5beeaa87eb7054d3ec
Author: Ruslan Bilovol <ruslan.bilovol@xxxxxxxxx>
Date:   Thu Jun 17 19:27:55 2021 +0300

    usb: gadget: f_hid: fix endianness issue with descriptors
    
    [ Upstream commit 33cb46c4676d01956811b68a29157ea969a5df70 ]
    
    Running sparse checker it shows warning message about
    incorrect endianness used for descriptor initialization:
    
    | f_hid.c:91:43: warning: incorrect type in initializer (different base types)
    | f_hid.c:91:43:    expected restricted __le16 [usertype] bcdHID
    | f_hid.c:91:43:    got int
    
    Fixing issue with cpu_to_le16() macro, however this is not a real issue
    as the value is the same both endians.
    
    Cc: Fabien Chouteau <fabien.chouteau@xxxxxxxxx>
    Cc: Segiy Stetsyuk <serg_stetsuk@xxxxxxx>
    Signed-off-by: Ruslan Bilovol <ruslan.bilovol@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20210617162755.29676-1-ruslan.bilovol@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index e55699308117..a82b3de1a54b 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -88,7 +88,7 @@ static struct usb_interface_descriptor hidg_interface_desc = {
 static struct hid_descriptor hidg_desc = {
 	.bLength			= sizeof hidg_desc,
 	.bDescriptorType		= HID_DT_HID,
-	.bcdHID				= 0x0101,
+	.bcdHID				= cpu_to_le16(0x0101),
 	.bCountryCode			= 0x00,
 	.bNumDescriptors		= 0x1,
 	/*.desc[0].bDescriptorType	= DYNAMIC */




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux