mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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: 3c095f32a9 ("PM / Domains: Add support for multi PM domains per device to genpd")
Signed-off-by: Ulf Hansson <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Acked-by: Niklas Cassel <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
e757e7fa3a
commit
71b77697af
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue