rtc: mt6397: check return value after calling platform_get_resource()
stable inclusion from stable-v5.10.122 commit 82bfea344e8f7e9a0e0b1bf9af27552baa756620 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=82bfea344e8f7e9a0e0b1bf9af27552baa756620 -------------------------------- [ Upstream commit d3b43eb5 ] It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Fixes: fc297911 ("rtc: mediatek: Add MT6397 RTC driver") Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Reviewed-by: NAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220505125043.1594771-1-yangyingliang@huawei.comSigned-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com>
Showing
想要评论请 注册 或 登录