staging: media: atomisp: don't free the current DVS 6-axis table on error
Subsystems (4)
PATCH 1/1 staging: media: atomisp: don't free the current DVS 6-axis table on error
When the new DVS 6-axis config has the same dimensions as the current one, atomisp_cp_dvs_6axis_config() reuses css_param->dvs_6axis instead of allocating a new table. If one of the following copies fails, the error path frees that table while css_param->dvs_6axis still points to it.
atomisp_set_parameters() handles the error by calling atomisp_free_css_parameters() on the same css_param, which frees css_param->dvs_6axis a second time.
Only free the table on error if it was allocated by this call, and leave the current table to its owner.
Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
Signed-off-by Feng Ning <[email protected]>
--- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_cmd.c +1 -1
@@ -2718,7 +2718,7 @@ int atomisp_cp_dvs_6axis_config(struct atomisp_sub_device *asd,return 0 ; error: -if (dvs_6axis_config) +if (dvs_6axis_config && dvs_6axis_config != css_param->dvs_6axis)ia_css_dvs2_6axis_config_free (dvs_6axis_config);return ret; }
Signature · 1 line
2.55.0