Skip to content

Commit e866dd8

Browse files
Dan Carpentergregkh
authored andcommitted
greybus: fix a leak on error in gb_module_create()
We should release ->interfaces[0] as well. Fixes: b15d97d ("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>
1 parent 1305f2b commit e866dd8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/staging/greybus/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
127127
return module;
128128

129129
err_put_interfaces:
130-
for (--i; i > 0; --i)
130+
for (--i; i >= 0; --i)
131131
gb_interface_put(module->interfaces[i]);
132132

133133
put_device(&module->dev);

0 commit comments

Comments
 (0)