mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
slimbus: core: use put_device() instead of kfree()
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
8de602885c
commit
bd329f028f
1 changed files with 1 additions and 1 deletions
|
|
@ -141,7 +141,7 @@ static struct slim_device *slim_alloc_device(struct slim_controller *ctrl,
|
|||
sbdev->e_addr = *eaddr;
|
||||
ret = slim_add_device(ctrl, sbdev, node);
|
||||
if (ret) {
|
||||
kfree(sbdev);
|
||||
put_device(&sbdev->dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue