linux-stable/drivers/opp
Manivannan Sadhasivam 2813cafbb8 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-13 09:47:57 +02:00
..
Kconfig drivers/opp: Remove "select SRCU" 2023-01-05 11:47:21 +05:30
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
core.c OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-13 09:47:57 +02:00
cpu.c OPP: Use consistent names for OPP table instances 2022-07-08 11:27:50 +05:30
debugfs.c OPP: fix error checking in opp_migrate_dentry() 2023-02-08 10:40:59 +05:30
of.c Devicetree updates for v6.4, part 2: 2023-04-27 10:09:05 -07:00
opp.h OPP: Move required opps configuration to specialized callback 2023-04-03 09:45:09 +05:30
ti-opp-supply.c OPP: ti: Migrate to dev_pm_opp_set_config_regulators() 2022-07-08 11:27:49 +05:30