Skip to content
Commit 2d47b79d authored by Yang Yingliang's avatar Yang Yingliang Committed by Wolfram Sang
Browse files

i2c: mux: reg: check return value after calling platform_get_resource()

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: b3fdd327

 ("i2c: mux: Add register-based mux i2c-mux-reg")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 810199f7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment