]> git.baikalelectronics.ru Git - kernel.git/commit
component: fix crash on x86_64 with hda audio drivers
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 26 Jan 2016 14:49:22 +0000 (14:49 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 26 Jan 2016 18:13:33 +0000 (18:13 +0000)
commit1026e7038561529a3ffcbcb211ad67717de0b79f
tree5388d90ba2bac34c530999d4e11e3f40c380281d
parentd81c2181d386599b029467e66e01b15adb8ff441
component: fix crash on x86_64 with hda audio drivers

Maarten reports that the addition of releasing match data to the
component helper results in a general protection fault on x86_64.

This is caused by the devm resources being freed in reverse order
to their allocation, which caused a use-after-free of the match
array.

Switch the match array to be a more conventional kmalloc/kfree()
affair, explicitly freeing it along with the parent match data
structure.

Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: d81c2181d386 ("component: add support for releasing match data")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/base/component.c