Skip to content
Commit d920920f authored by Manivannan Sadhasivam's avatar Manivannan Sadhasivam Committed by Viresh Kumar
Browse files

OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd()



If dev_pm_domain_attach_by_name() returns NULL, then 0 will be passed to
PTR_ERR() as reported by the smatch warning below:

drivers/opp/core.c:2456 _opp_attach_genpd() warn: passing zero to 'PTR_ERR'

Fix it by checking for the non-NULL virt_dev pointer before passing it to
PTR_ERR. Otherwise return -ENODEV.

Fixes: 4ea9496c ("opp: Fix error check in dev_pm_opp_attach_genpd()")
Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 7ddd8deb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment