diff options
author | Yang Yingliang | 2022-10-29 17:38:25 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2022-12-31 13:32:42 +0100 |
commit | f7a440c89b6d460154efeb058272760e41bdfea8 (patch) | |
tree | 1a4ee89078ded8d106d0ba4d3aa7663eb4aaf5d4 /fs/nilfs2 | |
parent | 86fdf151b9b8385fe08e6b8327728cf106a7e252 (diff) |
i2c: mux: reg: check return value after calling platform_get_resource()
[ Upstream commit 2d47b79d2bd39cc6369eccf94a06568d84c906ae ]
It will cause null-ptr-deref in resource_size(), if platform_get_resource()
returns NULL, move calling resource_size() after devm_ioremap_resource() that
will check 'res' to avoid null-ptr-deref.
And use devm_platform_get_and_ioremap_resource() to simplify code.
Fixes: b3fdd32799d8 ("i2c: mux: Add register-based mux i2c-mux-reg")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nilfs2')
0 files changed, 0 insertions, 0 deletions