linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: core: fix device reference leak in mfd_clone_cell
@ 2016-11-01 10:38 Johan Hovold
  2016-11-14 18:25 ` Lee Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hovold @ 2016-11-01 10:38 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Johan Hovold

Make sure to drop the reference taken by bus_find_device_by_name()
before returning from mfd_clone_cell().

Fixes: a9bbba996302 ("mfd: add platform_device sharing support for mfd")
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 3ac486a597f3..c57e407020f1 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -399,6 +399,8 @@ int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones)
 					clones[i]);
 	}
 
+	put_device(dev);
+
 	return 0;
 }
 EXPORT_SYMBOL(mfd_clone_cell);
-- 
2.7.3

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

end of thread, other threads:[~2016-11-16 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 10:38 [PATCH] mfd: core: fix device reference leak in mfd_clone_cell Johan Hovold
2016-11-14 18:25 ` Lee Jones
2016-11-16  9:17   ` Johan Hovold
2016-11-16  9:59     ` Lee Jones
2016-11-16 10:06       ` Johan Hovold
2016-11-16 15:17         ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).