]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda - Fix widget sysfs tree corruption after refresh
authorTakashi Iwai <tiwai@suse.de>
Wed, 26 Aug 2015 05:22:49 +0000 (07:22 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 26 Aug 2015 05:43:47 +0000 (07:43 +0200)
commita6a9ec8a8d29070b2f67d1a4b34d73b5bf87811a
tree416230268de6d2d4017974c3f8f5656ded436f81
parentc71b716df5a86fc1bd148c101c70f7e10cb46ef8
ALSA: hda - Fix widget sysfs tree corruption after refresh

When snd_hdac_refresh_widget_sysfs() is called before the first
hda_widget_sysfs_init(), the next call overrides and eventually
fails.  This results in unexpected Oops, something like:
  BUG: unable to handle kernel NULL pointer dereference at 00000000000000c8
  IP: [<ffffffff8180e2a3>] hdmi_chmap_ctl_info+0x23/0x40

The fix is to add a check of the existing sysfs tree.  Also, for more
safety, this patch adds the checks of device_is_registered() in
snd-hdac_refresh_wdiget_sysfs(), too.

Fixes: 57d04106efb4 ('ALSA: hda - Refresh widgets sysfs at probing Haswell+ HDMI codecs')
Bugizlla: https://bugzilla.kernel.org/show_bug.cgi?id=103431
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/hdac_device.c
sound/hda/hdac_sysfs.c