Skip to contentSkip to conversation

spi: fix parent-device reference leak

PATCH In review Johan Hovold 2 participants 2 messages Dec 14, 2015 – Dec 16, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: fix parent-device reference leak

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")
Cc stable <[email protected]> # v2.6.24
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi.c +1 -1
index 2b0a8ec3affb..dee1cb87d24f 100644
@@ -1705,7 +1705,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;
Signature · 1 line
2.4.10

A message that is not in the archive (sent off-list or not yet received): 1450106179-27623-1-git-send-email-johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

Applied "spi: fix parent-device reference leak" to the spi tree

The patch

spi: fix parent-device reference leak

has been applied to the spi tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 157f38f993919b648187ba341bfb05d0e91ad2f6 Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Mon, 14 Dec 2015 16:16:19 +0100
Subject: [PATCH] spi: fix parent-device reference leak

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")
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi.c +1 -1
index e2415be209d5..7bf25274ad78 100644
@@ -1704,7 +1704,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;
Signature · 6 lines
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html