Skip to content

Commit 91f4fe2

Browse files
jhovoldgregkh
authored andcommitted
spi: fix parent-device reference leak
commit 157f38f 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: 49dce68 ("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>
1 parent 456a39b commit 91f4fe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
12681268
master->bus_num = -1;
12691269
master->num_chipselect = 1;
12701270
master->dev.class = &spi_master_class;
1271-
master->dev.parent = get_device(dev);
1271+
master->dev.parent = dev;
12721272
spi_master_set_devdata(master, &master[1]);
12731273

12741274
return master;

0 commit comments

Comments
 (0)