Re: [PATCH] ASoC: SOF: acp: Add prevent against NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 17, 2023 at 09:16:06PM +0100, Kamil Duljas wrote:

>  		adata->fw_code_bin = kasprintf(GFP_KERNEL, "%s/sof-%s-code.bin",
> -					       plat_data->fw_filename_prefix,
> -					       chip->name);
> +							plat_data->fw_filename_prefix,
> +							chip->name);

Plese don't include spurious indentation changes like this, it just
makes the diff much harder to read.

> +		if (!adata->fw_code_bin)
> +			return -ENOMEM;
>  		adata->fw_data_bin = kasprintf(GFP_KERNEL, "%s/sof-%s-data.bin",
> -					       plat_data->fw_filename_prefix,
> -					       chip->name);
> +							plat_data->fw_filename_prefix,
> +							chip->name);
> +		if (!adata->fw_data_bin)
> +			return -ENOMEM;

This now leaks the code binary...

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux