mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user