mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: hw: fix to initialize function local variable
This commit is to fix below warning.
pcm_hw.c: In function ‘snd1_pcm_hw_open_fd’:
pcm_hw.c:955:33: warning: ‘mmap_control’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (mmap_control == MAP_FAILED || mmap_control == NULL) {
^
pcm_hw.c:946:31: note: ‘mmap_control’ was declared here
struct snd_pcm_mmap_control *mmap_control;
^~~~~~~~~~~~
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
8ef3805f1b
commit
ec16d21f86
1 changed files with 1 additions and 0 deletions
|
|
@ -904,6 +904,7 @@ static bool map_control_data(snd_pcm_hw_t *hw,
|
|||
struct snd_pcm_mmap_control *mmap_control;
|
||||
bool fallbacked;
|
||||
|
||||
mmap_control = MAP_FAILED;
|
||||
if (!force_fallback) {
|
||||
mmap_control = mmap(NULL, page_align(sizeof(*mmap_control)),
|
||||
PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue