Re: [PATCH v4] ASOC: dapm: add code to configure dai link parameters

From: Mark Brown
Date: Sat Sep 06 2014 - 10:17:06 EST


On Mon, Sep 01, 2014 at 09:56:53AM +0100, Nikesh Oswal wrote:
> dai-link params for codec-codec links were fixed. The fixed
> link between codec and another chip which may be another codec,
> baseband, bluetooth codec etc may require run time configuaration
> changes. This change provides an optional alsa control to select
> one of the params from a list of params.

As I'm fairly sure I've told you several times now please use subject
lines matching the style for the subsystem - if your commit logs look
different to all the other commit logs that's probably not a good sign.
In this specific case "ASOC" and "ASoC" are not the same thing.

> + for (count = 0 ; count < num_params; count++) {
> + w_param_text[count] = kmemdup((void *)(config->stream_name),
> + strlen(config->stream_name) + 1, GFP_KERNEL);
> + if (!w_param_text[count]) {
> + ret = -ENOMEM;
> + goto outfree_w_param;
> + }
> + config++;
> + }

This will happily create values with a completely empty name if the user
didn't specify one. This doesn't seem great - it's going to be an easy
mistake to make and fail to notice. I'd at least expect a warning here.

> + w_param_enum[0].items = num_params;
> + w_param_enum[0].texts = (const char * const *) w_param_text;

Why the casts? This tends to be a sign that something is wrong.

Attachment: signature.asc
Description: Digital signature