[alsa-devel] [PATCH] ASoC: rt5663: Fix error handling of device_property_read_u32_array

Mark Brown broonie at kernel.org
Mon Jan 7 17:04:59 CET 2019


On Sat, Jan 05, 2019 at 07:44:27AM -0600, Aditya Pakki wrote:

>  		rt5663->imp_table = devm_kzalloc(dev, table_size, GFP_KERNEL);
> -		device_property_read_u32_array(dev,
> +		return device_property_read_u32_array(dev,
>  			"realtek,impedance_sensing_table",
>  			(u32 *)rt5663->imp_table, table_size);

This is going to silently fail without giving any indication of what's
wrong which isn't great - it's not clear that completely failing to load
the driver is the best option here, and even if it is we should probably
tell the user what went wrong.

We're also not checking the result of the memory allocation...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20190107/a0560b05/attachment-0001.sig>


More information about the Alsa-devel mailing list