diff options
author | Mauro Carvalho Chehab <[email protected]> | 2020-05-12 12:45:40 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2020-05-20 14:51:28 +0200 |
commit | 4877b19e13a3a550819349ea0d46b5f0b775ed3f (patch) | |
tree | 93404732681fabd1ae518c89357df9861abbb348 | |
parent | b4dc4e139beb406784c4ef2f1bc359eac37de5be (diff) |
media: atomisp: spctrl: be sure to zero .code_addr after free
We need that to avoid trying to double-free the driver.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c b/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c index ceaac8235b4b..db39fa273251 100644 --- a/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c +++ b/drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c @@ -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; } |