aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2016-11-01 11:38:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-26 09:54:53 +0100
commitdd214a159de6089aa0f33e56e54f20016d96bbd7 (patch)
tree2862a1bd94c5d319fedb2425c125e46e2faa0aa8
parentd2adb5ebec617d60d557be723a1f95aaa65884db (diff)
downloadlinux-linaro-stable-dd214a159de6089aa0f33e56e54f20016d96bbd7.tar.gz
mfd: core: Fix device reference leak in mfd_clone_cell
commit 722f191080de641f023feaa7d5648caf377844f5 upstream. 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> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mfd/mfd-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 60b60dc63ddd..022c9374ce8b 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -354,6 +354,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);