greybus: fix a leak on error in gb_module_create()
We should release ->interfaces[0] as well.
Fixes: b15d97d770
("greybus: core: add module abstraction")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1305f2b2f5
commit
e866dd8aab
1 changed files with 1 additions and 1 deletions
|
@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
|
|||
return module;
|
||||
|
||||
err_put_interfaces:
|
||||
for (--i; i > 0; --i)
|
||||
for (--i; i >= 0; --i)
|
||||
gb_interface_put(module->interfaces[i]);
|
||||
|
||||
put_device(&module->dev);
|
||||
|
|
Loading…
Add table
Reference in a new issue