]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: xen-front: fix unintention integer overflow on left shifts
authorColin Ian King <colin.king@canonical.com>
Thu, 27 Jun 2019 16:58:53 +0000 (17:58 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 28 Jun 2019 08:41:17 +0000 (10:41 +0200)
commite58a4b21686efb3a223c7737b9c5a84006b136db
tree8c54904723ccb91d62799875f7670168cfae5796
parent96be8b12c0082e51d0d5c68d1ad2a5c1f5ee9887
ALSA: xen-front: fix unintention integer overflow on left shifts

Shifting the integer value 1 is evaluated using 32-bit
arithmetic and then used in an expression that expects a 64-bit
value, so there is potentially an integer overflow. Fix this
by using the BIT_ULL macro to perform the shift.

[ Note: as of the time being, no actual integer overflow hits because
  all values are less than 32bit, not including the extended 3-byte or
  DSD formats.  But this is the right fix for future usage, of
  course. -- tiwai ]

Addresses-Coverity: ("Unintentional integer overflow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/xen/xen_snd_front_alsa.c