Skip to contentSkip to conversation

ALSA: hda - Fix internal mic for Lenovo Ideapad U300s

DISCUSSION Dan Carpenter 2 participants 2 messages Apr 10, 2012

lore
Share & tools
lore
#0 lore raw

Hello David Henningsson,

This is a semi-automatic email about new static checker warnings.

The patch 18dcd3044e4c: "ALSA: hda - Fix internal mic for Lenovo Ideapad U300s" from Apr 2, 2012, leads to the following Smatch complaint:

sound/pci/hda/patch_conexant.c:4449 apply_fixup()
error: we previously assumed 'quirk' could be null (see line 4444)

sound/pci/hda/patch_conexant.c
4443 quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);

  4444		if (quirk && table[quirk->value]) {
                    ^^^^^

Old check.

4445 snd_printdd(KERN_INFO "hda_codec: applying pincfg for %s\n",
4446 quirk->name);
4447 apply_pincfg(codec, table[quirk->value]);
4448 }

  4449		if (quirk->value == CXT_FIXUP_STEREO_DMIC) {
                    ^^^^^^^^^^^^

New unchecked dereference.

4450 snd_printdd(KERN_INFO "hda_codec: applying internal mic workaround for %s\n",
4451 quirk->name);

regards,
dan carpenter

#1 lore raw
Quoted 10 lines · Dan Carpenter

Hello David Henningsson,

This is a semi-automatic email about new static checker warnings.

The patch 18dcd3044e4c: "ALSA: hda - Fix internal mic for Lenovo Ideapad U300s" from Apr 2, 2012, leads to the following Smatch complaint:

sound/pci/hda/patch_conexant.c:4449 apply_fixup()
error: we previously assumed 'quirk' could be null (see line 4444)

Thanks for spotting - will provide patch shortly.

Quoted 21 lines

sound/pci/hda/patch_conexant.c

   4443		quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
   4444		if (quirk&&  table[quirk->value]) {
                     ^^^^^

Old check.

   4445			snd_printdd(KERN_INFO "hda_codec: applying pincfg for %s\n",
   4446				    quirk->name);
   4447			apply_pincfg(codec, table[quirk->value]);
   4448		}
   4449		if (quirk->value == CXT_FIXUP_STEREO_DMIC) {
                     ^^^^^^^^^^^^

New unchecked dereference.

4450 snd_printdd(KERN_INFO "hda_codec: applying internal mic workaround for %s\n",
4451 quirk->name);

regards,
dan carpenter

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic