aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-12 12:45:40 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-20 14:51:28 +0200
commit4877b19e13a3a550819349ea0d46b5f0b775ed3f (patch)
tree93404732681fabd1ae518c89357df9861abbb348 /drivers/staging
parentmedia: atomisp: add support for different PMIC configurations (diff)
downloadwireguard-linux-4877b19e13a3a550819349ea0d46b5f0b775ed3f.tar.xz
wireguard-linux-4877b19e13a3a550819349ea0d46b5f0b775ed3f.zip
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 <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/pci/runtime/spctrl/src/spctrl.c4
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;
}