[alsa-devel] [PATCH 28/44] fireworks: Add command/response functionality into hwdep interface

Takashi Sakamoto o-takashi at sakamocchi.jp
Fri Apr 4 17:13:11 CEST 2014


Clemens,

I realized this patch include another bug...

> +static long
> +hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
> +	    loff_t *offset)
> +{
> ...
> +	/* check seqnum is not for kernel-land */
> +	seqnum = ((struct snd_efw_transaction *)buf)->seqnum;
> +	if (seqnum + 2 > SND_EFW_TRANSACTION_SEQNUM_MAX) {
> +		count = -EINVAL;
> +		goto end;
> +	}

I expect that the user data consists of __be32 array. So the correct way 
to calculate seqnum is:

seqnum = be32_to_cpu(((struct snd_efw_transaction *)buf)->seqnum);


Regards

Takashi Sakamoto
o-takashi at sakamocchi.jp



More information about the Alsa-devel mailing list