hda driver: don't read uninitialized memory

git-svn-id: svn://kolibrios.org@4555 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2014-02-03 16:53:45 +00:00
parent 3416e337d4
commit 35e895c7dc

View File

@ -833,6 +833,7 @@ proc read_pin_defaults
test eax, eax test eax, eax
jz .err_out jz .err_out
mov [codec.init_pins], eax mov [codec.init_pins], eax
mov [codec.num_pins], 0
mov edi, eax mov edi, eax
;Asper ] ;Asper ]
@ -855,19 +856,14 @@ end if
mov [edi + HDA_PINCFG.nid], bx mov [edi + HDA_PINCFG.nid], bx
stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_CONFIG_DEFAULT, 0 stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_CONFIG_DEFAULT, 0
mov [edi + HDA_PINCFG.cfg], eax mov [edi + HDA_PINCFG.cfg], eax
add edi, HDA_PINCFG.sizeof
inc [codec.num_pins]
.continue: .continue:
add edi, HDA_PINCFG.sizeof
inc ebx inc ebx
dec ecx dec ecx
jnz .next_node jnz .next_node
;Asper [
and ebx, 0xFFFF
sub bx, [codec.start_nid]
mov [codec.num_pins], ebx
;Asper ]
pop edi edx ecx ebx pop edi edx ecx ebx
xor eax, eax xor eax, eax
ret ret