remoteproc: qcom: q6v5-mss: fixup q6v5_pds_enable error handling

dev_pm_domain_attach_by_name will return NULL if the requested
power-domain is not a part device node. This could result in
NULL pointer de-reference in q6v5_pds_enable. Fix this by
checking for IS_ERR_OR_NULL and forward the appropriate error
code.

Fixes: 4760a896be ("remoteproc: q6v5-mss: Vote for rpmh power domains")
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Sibi Sankar 2019-08-21 23:35:48 +05:30 committed by Bjorn Andersson
parent 6ed756aa01
commit f2583fde27
1 changed files with 2 additions and 2 deletions

View File

@ -1282,8 +1282,8 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
for (i = 0; i < num_pds; i++) {
devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
if (IS_ERR(devs[i])) {
ret = PTR_ERR(devs[i]);
if (IS_ERR_OR_NULL(devs[i])) {
ret = PTR_ERR(devs[i]) ? : -ENODATA;
goto unroll_attach;
}
}