clk: tegra: dfll: Fix a potential Oop in remove()
If tegra_dfll_unregister() fails then "soc" is an error pointer. We
should just return instead of dereferencing it.
Fixes: 1752c9ee23
("clk: tegra: dfll: Fix drvdata overwriting issue")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
48504619a6
commit
d39eca547f
|
@ -133,9 +133,11 @@ static int tegra124_dfll_fcpu_remove(struct platform_device *pdev)
|
|||
struct tegra_dfll_soc_data *soc;
|
||||
|
||||
soc = tegra_dfll_unregister(pdev);
|
||||
if (IS_ERR(soc))
|
||||
if (IS_ERR(soc)) {
|
||||
dev_err(&pdev->dev, "failed to unregister DFLL: %ld\n",
|
||||
PTR_ERR(soc));
|
||||
return PTR_ERR(soc);
|
||||
}
|
||||
|
||||
tegra_cvb_remove_opp_table(soc->dev, soc->cvb, soc->max_freq);
|
||||
|
||||
|
|
Loading…
Reference in New Issue