Commit e866dd8a authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

greybus: fix a leak on error in gb_module_create()

We should release ->interfaces[0] as well.

Fixes: b15d97d7 ("greybus: core: add module abstraction")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1305f2b2
...@@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id, ...@@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
return module; return module;
err_put_interfaces: err_put_interfaces:
for (--i; i > 0; --i) for (--i; i >= 0; --i)
gb_interface_put(module->interfaces[i]); gb_interface_put(module->interfaces[i]);
put_device(&module->dev); put_device(&module->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment