提交 71b77697 编写于 作者: U Ulf Hansson 提交者: Rafael J. Wysocki

PM / Domains: Don't kfree() the virtual device in the error path

It's not correct to call kfree(dev) when device_register(dev) has failed.

Fix this by calling put_device(dev) instead.

Fixes: 3c095f32 ("PM / Domains: Add support for multi PM domains per device to genpd")
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Acked-by: NNiklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 e757e7fa
......@@ -2455,7 +2455,7 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev,
ret = device_register(virt_dev);
if (ret) {
kfree(virt_dev);
put_device(virt_dev);
return ERR_PTR(ret);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册