Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d5ad630b6dd00ea41e0c58b45c0912f72757b5cd Commit: d5ad630b6dd00ea41e0c58b45c0912f72757b5cd Parent: 6d7b1d7d09e00034325b09a3a7ac7b0ea5e29506 Author: Takashi Iwai <[EMAIL PROTECTED]> AuthorDate: Wed Mar 7 15:55:59 2007 +0100 Committer: Jaroslav Kysela <[EMAIL PROTECTED]> CommitDate: Fri May 11 16:55:44 2007 +0200
[ALSA] Fix NULL dereference with null modelname Fix the NULL dereference of modelname option. The check is moved to find_codec_preset() now, too. Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]> Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]> --- sound/pci/hda/hda_codec.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 4c0a6a5..e768187 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -403,6 +403,9 @@ static const struct hda_codec_preset *find_codec_preset(struct hda_codec *codec) { const struct hda_codec_preset **tbl, *preset; + if (codec->bus->modelname && !strcmp(codec->bus->modelname, "generic")) + return NULL; /* use the generic parser */ + for (tbl = hda_preset_tables; *tbl; tbl++) { for (preset = *tbl; preset->id; preset++) { u32 mask = preset->mask; @@ -573,8 +576,7 @@ int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, 0); } - if (strcmp(codec->bus->modelname, "generic")) - codec->preset = find_codec_preset(codec); + codec->preset = find_codec_preset(codec); if (! *bus->card->mixername) snd_hda_get_codec_name(codec, bus->card->mixername, sizeof(bus->card->mixername)); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html