Yang Yingliang 5289795824 mfd: davinci_voicecodec: Fix possible null-ptr-deref davinci_vc_probe()
[ Upstream commit 311242c7703df0da14c206260b7e855f69cb0264 ]

It will cause null-ptr-deref when using 'res', if platform_get_resource()
returns NULL, so move using 'res' after devm_ioremap_resource() that
will check it to avoid null-ptr-deref.
And use devm_platform_get_and_ioremap_resource() to simplify code.

Fixes: b5e29aa880be ("mfd: davinci_voicecodec: Remove pointless #include")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220426030857.3539336-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:23:12 +02:00
..
2021-09-07 12:38:59 -07:00
2019-07-02 12:11:31 +01:00
2019-07-15 20:18:40 -07:00
2021-09-07 12:38:59 -07:00
2021-03-10 10:58:33 +00:00
2021-06-15 13:02:53 +01:00
2019-07-09 08:59:39 -07:00