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 <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1305f2b commit e866dd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)