]> www.infradead.org Git - users/dwmw2/linux.git/commit
USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 17 Mar 2022 20:39:10 +0000 (16:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:39:49 +0000 (14:39 +0200)
commit1e0f089f70db06f2d1d3e5b973de83e71c4038da
treede8fa849bb41001a729f336eab00d302dd607e15
parent39a70732eb52c95c28e8424d0240ea104a9c8890
USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c

commit 1892bf90677abcad7f06e897e308f5c3e3618dd4 upstream.

The kernel test robot found a problem with the ene_ub6250 subdriver in
usb-storage: It uses structures containing bitfields to represent
hardware bits in its SD_STATUS, MS_STATUS, and SM_STATUS bytes.  This
is not safe; it presumes a particular bit ordering and it assumes the
compiler will not insert padding, neither of which is guaranteed.

This patch fixes the problem by changing the structures to simple u8
values, with the bitfields replaced by bitmask constants.

CC: <stable@vger.kernel.org>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/YjOcbuU106UpJ/V8@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/ene_ub6250.c