From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752881AbcBNWez (ORCPT ); Sun, 14 Feb 2016 17:34:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41188 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753311AbcBNWeY (ORCPT ); Sun, 14 Feb 2016 17:34:24 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Mark Brown Subject: [PATCH 4.3 044/200] spi: fix parent-device reference leak Date: Sun, 14 Feb 2016 14:20:51 -0800 Message-Id: <20160214222218.740407407@linuxfoundation.org> X-Mailer: git-send-email 2.7.1 In-Reply-To: <20160214222217.084543173@linuxfoundation.org> References: <20160214222217.084543173@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 157f38f993919b648187ba341bfb05d0e91ad2f6 upstream. Fix parent-device reference leak due to SPI-core taking an unnecessary reference to the parent when allocating the master structure, a reference that was never released. Note that driver core takes its own reference to the parent when the master device is registered. Fixes: 49dce689ad4e ("spi doesn't need class_device") Signed-off-by: Johan Hovold Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1627,7 +1627,7 @@ struct spi_master *spi_alloc_master(stru master->bus_num = -1; master->num_chipselect = 1; master->dev.class = &spi_master_class; - master->dev.parent = get_device(dev); + master->dev.parent = dev; spi_master_set_devdata(master, &master[1]); return master;