Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);