Skip to contentSkip to conversation

Oops in set_spdif_output in i810_audio

DISCUSSION Herbert Xu 1 participant 2 messages Apr 3, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Herbert Xu

author
#1 lore raw
Quoted 7 lines · Andrew Morton

*** These are init messages & oops:
i810_audio: Unknown symbol ac97_set_dac_rate
i810_audio: Unknown symbol ac97_release_codec
i810_audio: Unknown symbol ac97_set_adc_rate
i810_audio: Unknown symbol ac97_alloc_codec
i810_audio: Unknown symbol ac97_probe_codec

The codec initialisation failed so the codec is NULL.

Quoted 1 line

EIP is at i810_set_spdif_output+0x22/0x160 [i810_audio]

Boom as we dereferenced the codec.

Is there any reason why we should allow i810_probe to succeed when there is no codec?

If not we can make i810_ac97_init fail in this case.

If so then we'll have to make sure that every dereference of codec in this driver checks whether it's NULL.

I personally don't see a reason why we should allow it to continue when the codec doesn't exist. What do you guys think?

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#2 lore raw
Quoted 3 lines · herbert

I personally don't see a reason why we should allow it to continue when the codec doesn't exist. What do you guys think?

Actually, anybody trying to use this driver without a codec would've hit the same crash. Since nobody has complained before, we should just fail the registration if there is no codec.

Then we can get rid of all the existing codec != NULL checks.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt