usbip: Fix unsafe unaligned pointer usage
authorShuah Khan <skhan@linuxfoundation.org>
Thu, 9 Jan 2020 01:24:16 +0000 (18:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:34:45 +0000 (08:34 +0100)
commitb957a310c92b33d6a3ccb3cc43f6b48fb592324e
treee8d0865c5ad7006bc289f2ca66ac4298d045bf96
parent26259921a2a0b08651b278ee0d88e5fc45935a24
usbip: Fix unsafe unaligned pointer usage

[ Upstream commit 585c91f40d201bc564d4e76b83c05b3b5363fe7e ]

Fix unsafe unaligned pointer usage in usbip network interfaces. usbip tool
build fails with new gcc -Werror=address-of-packed-member checks.

usbip_network.c: In function ‘usbip_net_pack_usb_device’:
usbip_network.c:79:32: error: taking address of packed member of ‘struct usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
   79 |  usbip_net_pack_uint32_t(pack, &udev->busnum);

Fix with minor changes to pass by value instead of by address.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20200109012416.2875-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/usb/usbip/src/usbip_network.c
tools/usb/usbip/src/usbip_network.h