diff options
author | Johan Hovold <johan@kernel.org> | 2015-12-14 18:16:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 01:28:25 +0300 |
commit | ed4c745d35785c4f5501a87f9d214ead4fcef203 (patch) | |
tree | ea1a9d9e342ca44c5d55558db7d527dc7a1b3ceb | |
parent | 6edfb956228a5cfbbb9e5dd9c4488cc93b3cfe91 (diff) | |
download | linux-ed4c745d35785c4f5501a87f9d214ead4fcef203.tar.xz |
spi: fix parent-device reference leak
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 <johan@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/spi/spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index a5f53de813d3..a83d9d07df58 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1627,7 +1627,7 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size) 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; |