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: aa167f3fed
("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>
This commit is contained in:
Родитель
5c0c4ec9ba
Коммит
bfecfd6e23
|
@ -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)
|
if (!desc->nodirmap && ctlr->mem_ops && ctlr->mem_ops->dirmap_destroy)
|
||||||
ctlr->mem_ops->dirmap_destroy(desc);
|
ctlr->mem_ops->dirmap_destroy(desc);
|
||||||
|
|
||||||
|
kfree(desc);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(spi_mem_dirmap_destroy);
|
EXPORT_SYMBOL_GPL(spi_mem_dirmap_destroy);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче