Lukas Wunner 04a9cd51d3
spi: npcm-fiu: Don't leak SPI master in probe error path
If the calls to of_match_device(), of_alias_get_id(),
devm_ioremap_resource(), devm_regmap_init_mmio() or devm_clk_get()
fail on probe of the NPCM FIU SPI driver, the spi_controller struct is
erroneously not freed.

Fix by switching over to the new devm_spi_alloc_master() helper.

Fixes: ace55c411b11 ("spi: npcm-fiu: add NPCM FIU controller driver")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: <stable@vger.kernel.org> # v5.4+: 5e844cc37a5c: spi: Introduce device-managed SPI controller allocation
Cc: <stable@vger.kernel.org> # v5.4+
Cc: Tomer Maimon <tmaimon77@gmail.com>
Link: https://lore.kernel.org/r/a420c23a363a3bc9aa684c6e790c32a8af106d17.1605512876.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-17 17:08:39 +00:00
..
2020-10-24 10:33:08 -07:00
2020-10-24 10:33:08 -07:00
2020-06-24 16:37:47 +01:00
2020-10-15 11:07:44 -07:00
2020-10-08 23:00:06 +01:00
2020-10-08 23:00:06 +01:00
2020-07-17 16:38:47 +01:00
2020-10-28 21:36:51 +00:00
2020-03-17 13:20:16 +00:00
2020-07-14 17:38:46 +01:00
2020-06-16 00:38:38 +01:00
2020-10-24 10:33:08 -07:00