OSDN Git Service

ALSA: usb-audio: fix sign unintended sign extension on left shifts
authorColin Ian King <colin.king@canonical.com>
Thu, 27 Jun 2019 16:43:08 +0000 (17:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:55:46 +0000 (09:55 +0200)
commit443449d4a149a65f20585f5084673575d660eec5
treece2ec927e2f4df8912626c10885919e302ba7761
parent8b449e9dc215e47641c4737a199b7767ffd032a9
ALSA: usb-audio: fix sign unintended sign extension on left shifts

commit 2acf5a3e6e9371e63c9e4ff54d84d08f630467a0 upstream.

There are a couple of left shifts of unsigned 8 bit values that
first get promoted to signed ints and hence get sign extended
on the shift if the top bit of the 8 bit values are set. Fix
this by casting the 8 bit values to unsigned ints to stop the
unintentional sign extension.

Addresses-Coverity: ("Unintended sign extension")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/mixer_quirks.c