Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

greybus: fix a leak on error in gb_module_create()

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

Fixes: b15d97d77017 ("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>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
e866dd8a 1305f2b2

+1 -1
+1 -1
drivers/staging/greybus/module.c
··· 127 127 return module; 128 128 129 129 err_put_interfaces: 130 - for (--i; i > 0; --i) 130 + for (--i; i >= 0; --i) 131 131 gb_interface_put(module->interfaces[i]); 132 132 133 133 put_device(&module->dev);