| 0d5bcfc9 | 31-May-2018 |
Dan Carpenter <[email protected]> |
ALSA: xen-front: fix a loop timeout
We want the loop to exit when "to" is set to zero, but in the current code it's set to -1. Also I tweaked the indenting so it doesn't look like we're passing "--
ALSA: xen-front: fix a loop timeout
We want the loop to exit when "to" is set to zero, but in the current code it's set to -1. Also I tweaked the indenting so it doesn't look like we're passing "--to" to xenbus_read_unsigned().
Fixes: cc3196ae197c ("ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Oleksandr Andrushchenko <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| 4c0eaac7 | 28-May-2018 |
Arnd Bergmann <[email protected]> |
ALSA: xen: ensure nul-terminated device name
gcc-8 warns that pcm_instance->name is not necessarily terminated correctly if the input is more than 80 characters long or lacks a termination byte itse
ALSA: xen: ensure nul-terminated device name
gcc-8 warns that pcm_instance->name is not necessarily terminated correctly if the input is more than 80 characters long or lacks a termination byte itself:
In function 'strncpy', inlined from 'cfg_device' at sound/xen/xen_snd_front_cfg.c:399:3, inlined from 'xen_snd_front_cfg_card' at sound/xen/xen_snd_front_cfg.c:509:9: include/linux/string.h:254:9: error: '__builtin_strncpy' specified bound 80 equals destination size [-Werror=stringop-truncation] return __builtin_strncpy(p, q, size);
Using strlcpy() instead of strncpy() makes this a bit safer.
Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Oleksandr Andrushchenko <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| 014cea59 | 27-May-2018 |
Colin Ian King <[email protected]> |
ALSA: xen-front: fix unsigned error check on return from to_sndif_format
The negative error return from the call to to_sndif_format is being assigned to an unsigned 8 bit integer and hence the check
ALSA: xen-front: fix unsigned error check on return from to_sndif_format
The negative error return from the call to to_sndif_format is being assigned to an unsigned 8 bit integer and hence the check for a negative value is always going to be false. Fix this by using ret as the error return and hence the negative error can be detected and assign the u8 sndif_format to ret if there is no error.
Detected by CoverityScan, CID#1469385 ("Unsigned compared against 0")
Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|