From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Lee Jones Subject: [PATCH 4.4 20/31] mfd: core: Fix device reference leak in mfd_clone_cell Date: Thu, 24 Nov 2016 15:55:41 +0100 Message-Id: <20161124145448.012559990@linuxfoundation.org> In-Reply-To: <20161124145446.993225208@linuxfoundation.org> References: <20161124145446.993225208@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold 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: Greg Kroah-Hartman --- drivers/mfd/mfd-core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -354,6 +354,8 @@ int mfd_clone_cell(const char *cell, con clones[i]); } + put_device(dev); + return 0; } EXPORT_SYMBOL(mfd_clone_cell);