lkml.org 
[lkml]   [2022]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ASoC: wm_adsp: Remove redundant NULL check before release_firmware() call
From
Date
On 06/06/2022 02:39, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> release_firmware() checks for NULL pointers internally so checking
> before calling it is redundant.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
> sound/soc/codecs/wm_adsp.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
> index 7973a75cac05..4c4344b21c2e 100644
> --- a/sound/soc/codecs/wm_adsp.c
> +++ b/sound/soc/codecs/wm_adsp.c
> @@ -739,12 +739,10 @@ static void wm_adsp_release_firmware_files(struct wm_adsp *dsp,
> const struct firmware *coeff_firmware,
> char *coeff_filename)
> {
> - if (wmfw_firmware)
> - release_firmware(wmfw_firmware);
> + release_firmware(wmfw_firmware);
> kfree(wmfw_filename);
>
> - if (coeff_firmware)
> - release_firmware(coeff_firmware);
> + release_firmware(coeff_firmware);
> kfree(coeff_filename);
> }
>
>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>

\
 
 \ /
  Last update: 2022-06-06 11:36    [W:0.062 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site