public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] greybus: fix a leak on error in gb_module_create()
@ 2016-10-14 19:18 Dan Carpenter
  2016-10-15  9:15 ` Johan Hovold
  2016-10-17  5:58 ` Viresh Kumar
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-10-14 19:18 UTC (permalink / raw)
  To: kernel-janitors

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

Fixes: b15d97d77017 ("greybus: core: add module abstraction")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/greybus/module.c b/drivers/staging/greybus/module.c
index 69f67dd..660b467 100644
--- a/drivers/staging/greybus/module.c
+++ b/drivers/staging/greybus/module.c
@@ -127,7 +127,7 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
 	return module;
 
 err_put_interfaces:
-	for (--i; i > 0; --i)
+	for (--i; i >= 0; --i)
 		gb_interface_put(module->interfaces[i]);
 
 	put_device(&module->dev);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] greybus: fix a leak on error in gb_module_create()
  2016-10-14 19:18 [patch] greybus: fix a leak on error in gb_module_create() Dan Carpenter
@ 2016-10-15  9:15 ` Johan Hovold
  2016-10-17  5:58 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2016-10-15  9:15 UTC (permalink / raw)
  To: kernel-janitors

On Fri, Oct 14, 2016 at 10:18:21PM +0300, Dan Carpenter wrote:
> We should release ->interfaces[0] as well.

Indeed. Thanks for the fix.

> Fixes: b15d97d77017 ("greybus: core: add module abstraction")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Johan Hovold <johan@kernel.org>

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] greybus: fix a leak on error in gb_module_create()
  2016-10-14 19:18 [patch] greybus: fix a leak on error in gb_module_create() Dan Carpenter
  2016-10-15  9:15 ` Johan Hovold
@ 2016-10-17  5:58 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2016-10-17  5:58 UTC (permalink / raw)
  To: kernel-janitors

On Sat, Oct 15, 2016 at 12:48 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-17  5:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 19:18 [patch] greybus: fix a leak on error in gb_module_create() Dan Carpenter
2016-10-15  9:15 ` Johan Hovold
2016-10-17  5:58 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox