Skip to content
Snippets Groups Projects
Commit 3aa73aac authored by Detlev Casanova's avatar Detlev Casanova
Browse files

media: verisilicon: Free post processor buffers on error


When initializing the post processor, it allocates the same number of
buffers as the buf queue.
As the init function is called in streamon(), if an allocation fails,
streamon will return an error and streamoff() will not be called, keeping
all post processor buffers allocated.

To avoid that, all post proc buffers are freed in case of an allocation
error.

Fixes: 26711491 ("media: verisilicon: Refactor postprocessor to store more buffers")
Signed-off-by: default avatarDetlev Casanova <detlev.casanova@collabora.com>
parent 02ddfb98
No related branches found
No related tags found
No related merge requests found
...@@ -250,8 +250,10 @@ int hantro_postproc_init(struct hantro_ctx *ctx) ...@@ -250,8 +250,10 @@ int hantro_postproc_init(struct hantro_ctx *ctx)
for (i = 0; i < num_buffers; i++) { for (i = 0; i < num_buffers; i++) {
ret = hantro_postproc_alloc(ctx, i); ret = hantro_postproc_alloc(ctx, i);
if (ret) if (ret) {
hantro_postproc_free(ctx);
return ret; return ret;
}
} }
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment