linux-stable/drivers/opp
Manivannan Sadhasivam 3eb241e47d OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd()
[ Upstream commit d920920f85 ]

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: 4ea9496cbc ("opp: Fix error check in dev_pm_opp_attach_genpd()")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 10:59:40 +02:00
..
Kconfig
Makefile
core.c OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-23 10:59:40 +02:00
cpu.c
debugfs.c OPP: fix error checking in opp_migrate_dentry() 2023-03-11 16:43:41 +01:00
of.c opp: Fix return in _opp_add_static_v2() 2021-11-17 09:48:44 +01:00
opp.h
ti-opp-supply.c