Bug 197307
Summary: | Double kobject registration and use of unitialized memory in snd_hda_codec_hdmi | ||
---|---|---|---|
Product: | Drivers | Reporter: | Tvrtko Ursulin (tursulin) |
Component: | Sound(ALSA) | Assignee: | Jaroslav Kysela (perex) |
Status: | NEW --- | ||
Severity: | normal | CC: | tiwai, tursulin |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.14.0-rc5 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
alsa-info output
Fix patch |
Description
Tvrtko Ursulin
2017-10-18 07:53:16 UTC
Created attachment 260263 [details]
alsa-info output
How is the procedure to reproduce? Does it happen always even at the first load of modules? This happened on boot with a lot of the debug options turned on. Afterwards I turned off kobject debugging and I think it did not happen afterwards. Not sure if that is feasible or not, that kobject debugging would affect it. Hm.. I can try again when I get some free time. Could you check whether forcibly re-initializing like below changes the behavior? --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -420,14 +420,14 @@ int snd_hdac_refresh_widget_sysfs(struct hdac_device *cod\ ec) { int ret; - if (device_is_registered(&codec->dev)) + if (1) hda_widget_sysfs_exit(codec); ret = snd_hdac_refresh_widgets(codec); if (ret) { dev_err(&codec->dev, "failed to refresh widget: %d\n", ret); return ret; } - if (device_is_registered(&codec->dev)) { + if (1) { ret = hda_widget_sysfs_init(codec); if (ret) { dev_err(&codec->dev, "failed to init sysfs: %d\n", ret); Ah wait, this might be the side-effect of CONFIG_DEBUG_KOBJECT_RELEASE. It delays the release of kobject while the current code believes it's been already released (that's a valid assumption since it's never used yet, so not referenced). Please check whether the issue is reproduced even without that kconfig. I can't get it to trigger without CONFIG_DEBUG_KOBJECT_RELEASE. I tried two times in both configs and it is 2/2 with it, and 0/2 without it. OK, could you try the patch below? This should work around the issue with CONFIG_DEBUG_KOBJECT_RELEASE. Created attachment 260271 [details]
Fix patch
I'll try but at the moment busy with other stuff. Please feel free to ping me if no news from me in a week. |