Skip to content

Commit

Permalink
media: atomisp: spctrl: be sure to zero .code_addr after free
Browse files Browse the repository at this point in the history
We need that to avoid trying to double-free the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Mauro Carvalho Chehab committed May 20, 2020
1 parent b4dc4e1 commit 4877b19
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ enum ia_css_err ia_css_spctrl_unload_fw(sp_ID_t sp_id)
return IA_CSS_ERR_INVALID_ARGUMENTS;

/* freeup the resource */
if (spctrl_cofig_info[sp_id].code_addr)
if (spctrl_cofig_info[sp_id].code_addr) {
hmm_free(spctrl_cofig_info[sp_id].code_addr);
spctrl_cofig_info[sp_id].code_addr = mmgr_NULL;
}
spctrl_loaded[sp_id] = false;
return IA_CSS_SUCCESS;
}
Expand Down

0 comments on commit 4877b19

Please sign in to comment.