Merge branch 'pm-powercap'
Fix a possible memory leak in the power capping subsystem (Joe Hattori). * pm-powercap: powercap: call put_device() on an error path in powercap_register_control_type()
This commit is contained in:
commit
73195bed78
1 changed files with 1 additions and 2 deletions
|
@ -627,8 +627,7 @@ struct powercap_control_type *powercap_register_control_type(
|
|||
dev_set_name(&control_type->dev, "%s", name);
|
||||
result = device_register(&control_type->dev);
|
||||
if (result) {
|
||||
if (control_type->allocated)
|
||||
kfree(control_type);
|
||||
put_device(&control_type->dev);
|
||||
return ERR_PTR(result);
|
||||
}
|
||||
idr_init(&control_type->idr);
|
||||
|
|
Loading…
Add table
Reference in a new issue