Skip to content

Commit

Permalink
rimage: (cosmetic) remove redundant NULL-checks
Browse files Browse the repository at this point in the history
free(NULL) is allowed, remove redundant checks.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh authored and kv2019i committed Dec 3, 2024
1 parent cf31c9c commit 3a828a7
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions tools/rimage/src/adsp_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2359,23 +2359,12 @@ void adsp_free(struct adsp *adsp)
if (!adsp)
return;

if (adsp->man_v1_5)
free(adsp->man_v1_5);

if (adsp->man_v1_5_sue)
free(adsp->man_v1_5_sue);

if (adsp->man_v1_8)
free(adsp->man_v1_8);

if (adsp->man_v2_5)
free(adsp->man_v2_5);

if (adsp->modules)
free(adsp->modules);

if (adsp->name)
free((char *)adsp->name);
free(adsp->man_v1_5);
free(adsp->man_v1_5_sue);
free(adsp->man_v1_8);
free(adsp->man_v2_5);
free(adsp->modules);
free((void *)adsp->name);

free(adsp);
}

0 comments on commit 3a828a7

Please sign in to comment.