summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPenny Chiu <pchiu@nvidia.com>2018-08-14 00:51:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-16 10:43:02 -0400
commit252b7276085f2ec3058d15bae9baed42537be24e (patch)
treef11d1f0bba75caae450eaccd2893742d5daa1fe9 /include/linux
parentadebfd783a6a4ffc431edffd929b95a136c56bb7 (diff)
tegra: hda: Fix crash when max codec is zero
hda->num_codecs is the maximum codecs number which is read from device tree. It will be zero if the property is not defined in device tree, and causes following crashes: Internal error: Oops: 96000047 [#1] PREEMPT SMP Modules linked in: snd_soc_tegra_alt_utils snd_hda_tegra r8168 ahci_tegra nvgpu CPU: 0 PID: 1169 Comm: kworker/0:2 Not tainted 4.14.56-tegra-05815-g70d0001-dirty #5 Hardware name: darcy (DT) Workqueue: events hda_tegra_probe_work [snd_hda_tegra] task: ffffffc0bab4c880 task.stack: ffffff800cb98000 PC is at hda_tegra_create_sysfs+0x17c/0x240 [snd_hda_tegra] LR is at hda_tegra_create_sysfs+0x148/0x240 [snd_hda_tegra] pc : [<ffffff80014d35d4>] lr : [<ffffff80014d35a0>] pstate: 80400045 sp : ffffff800cb9bc50 Internal error: Oops: 96000005 [#1] PREEMPT SMP Modules linked in: snd_soc_tegra210_alt_xbar snd_soc_tegra_alt_utils snd_hda_tegra r8168 ahci_tegra nvgpu CPU: 2 PID: 42 Comm: kworker/u8:3 Not tainted 4.14.56-tegra-05815-g70d0001-dirty #5 Hardware name: darcy (DT) Workqueue: events_unbound async_run_entry_fn task: ffffffc0bacce580 task.stack: ffffff800a670000 PC is at rb_erase+0xc8/0x418 LR is at __free_vmap_area+0x60/0x110 This is because hda_tegra_create_sysfs() uses hda->num_codecs as size to allocate memory, but the value is zero. To fix the crash issue, when creating sysfs, it should uses azx_bus(chip)->num_codecs which is actual number of codecs instead of maximum number of codecs. Bug 200422707 Change-Id: Ieb854adf0c79b79cab6168c0ae563631bbb2b15c Signed-off-by: Penny Chiu <pchiu@nvidia.com> Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1799341 Reviewed-by: Sharad Gupta <sharadg@nvidia.com> Reviewed-by: Vince Hsu <vinceh@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions