From: Johan Hovold Date: Tue, 1 Nov 2016 10:38:18 +0000 (+0100) Subject: mfd: core: Fix device reference leak in mfd_clone_cell X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26b5a4a56fd60530d0ab3b51a7fda5841d4f9316;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: Lee Jones Signed-off-by: Willy Tarreau --- diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 7604f4e5df40..af6a245dc505 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -263,6 +263,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);