mirror of https://github.com/thesofproject/sof.git
ipc: buffer: Properly free buffer using buffer_free instead of rfree.
In case of lack of memory to allocate control struct for newly created buffer, pointer to that buffer was rfree'd instead of proper buffer_free call, which would have resulted in memory leak. This patch is to address this issue. Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
This commit is contained in:
parent
6e43ab8ecd
commit
6749a36c3c
|
@ -274,7 +274,7 @@ int ipc_buffer_new(struct ipc *ipc, struct sof_ipc_buffer *desc)
|
|||
ibd = rzalloc(SOF_MEM_ZONE_RUNTIME, SOF_MEM_FLAG_SHARED,
|
||||
SOF_MEM_CAPS_RAM, sizeof(struct ipc_comp_dev));
|
||||
if (ibd == NULL) {
|
||||
rfree(buffer);
|
||||
buffer_free(buffer);
|
||||
return -ENOMEM;
|
||||
}
|
||||
ibd->cb = buffer;
|
||||
|
|
Loading…
Reference in New Issue