Skip to content

Commit

Permalink
media: venus: core: Fix error handling in probe
Browse files Browse the repository at this point in the history
[ Upstream commit 98cd831 ]

Post a successful pm_ops->core_get, an error in probe
should exit by doing a pm_ops->core_put which seems
to be missing. So fix it.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Rajendra Nayak authored and gregkh committed Oct 29, 2020
1 parent 91cde7d commit 6ed15ee
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/media/platform/qcom/venus/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ static int venus_probe(struct platform_device *pdev)

ret = dma_set_mask_and_coherent(dev, core->res->dma_mask);
if (ret)
return ret;
goto err_core_put;

if (!dev->dma_parms) {
dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
GFP_KERNEL);
if (!dev->dma_parms)
return -ENOMEM;
if (!dev->dma_parms) {
ret = -ENOMEM;
goto err_core_put;
}
}
dma_set_max_seg_size(dev, DMA_BIT_MASK(32));

Expand All @@ -242,11 +244,11 @@ static int venus_probe(struct platform_device *pdev)
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
"venus", core);
if (ret)
return ret;
goto err_core_put;

ret = hfi_create(core, &venus_core_ops);
if (ret)
return ret;
goto err_core_put;

pm_runtime_enable(dev);

Expand Down Expand Up @@ -302,6 +304,9 @@ static int venus_probe(struct platform_device *pdev)
pm_runtime_set_suspended(dev);
pm_runtime_disable(dev);
hfi_destroy(core);
err_core_put:
if (core->pm_ops->core_put)
core->pm_ops->core_put(dev);
return ret;
}

Expand Down

0 comments on commit 6ed15ee

Please sign in to comment.