]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
firmware: fix capturing errors on fw_cache_init() on early init
authorLuis R. Rodriguez <mcgrof@kernel.org>
Mon, 20 Nov 2017 17:45:32 +0000 (09:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Nov 2017 10:07:00 +0000 (11:07 +0100)
commit59b6d859ff0e36872396afdd3d853036408a87dc
tree59470a3ee2f40a02b4c92c56aa22dc72c627f98b
parenta67e503b67a8b0d99c3fa96ae6c254ca5d8bb2ba
firmware: fix capturing errors on fw_cache_init() on early init

register_pm_notifier() can technically fail, caputure this.
Note that register_syscore_ops() cannot fail given it just
adds an element to a linked list. This has been broken since
v3.7. Chances of this failing however are slim.

To improve code readability move the code folded under CONFIG_PM_SLEEP
into a helper.

Fixes: 07646d9c0938d ("firmware loader: cache devices firmware during suspend/resume cycle")
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_class.c