diff options
author | Boris Brezillon <bbrezillon@kernel.org> | 2019-01-19 17:57:57 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-01-21 20:57:14 +0300 |
commit | bfecfd6e23bf677c85828eb20fa4b13a18bffe23 (patch) | |
tree | 818c65255f644de45463589a02ef38d3d056cac1 /drivers/spi/spi-mem.c | |
parent | 5c0c4ec9ba61a98ecb79036afc013bba8d5b85e3 (diff) | |
download | linux-bfecfd6e23bf677c85828eb20fa4b13a18bffe23.tar.xz |
spi: spi-mem: Fix a memory leak in spi_mem_dirmap_destroy()
The dirmap descriptor object allocated in spi_mem_dirmap_create is
never freed. Add a kfree(desc) in spi_mem_dirmap_destroy().
Fixes: aa167f3fed0c ("spi: spi-mem: Add a new API to support direct mapping")
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-mem.c')
-rw-r--r-- | drivers/spi/spi-mem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index 08ba43506e81..9487c9cd68bd 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -547,6 +547,8 @@ void spi_mem_dirmap_destroy(struct spi_mem_dirmap_desc *desc) if (!desc->nodirmap && ctlr->mem_ops && ctlr->mem_ops->dirmap_destroy) ctlr->mem_ops->dirmap_destroy(desc); + + kfree(desc); } EXPORT_SYMBOL_GPL(spi_mem_dirmap_destroy); |