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 <arvind.yadav.cs@gmail.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Este cometimento está contido em:

cometido por
Greg Kroah-Hartman

ascendente
8de602885c
cometimento
bd329f028f
@@ -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;
|
||||
}
|
||||
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador