[alsa-devel] [PATCH 2/5] ALSA: snd-usb: implement new endpoint streaming model
Daniel Mack
zonque at gmail.com
Tue Dec 20 21:08:01 CET 2011
On 12/20/2011 04:42 PM, Takashi Iwai wrote:
> At Tue, 20 Dec 2011 10:48:37 +0100,
> Daniel Mack wrote:
>>
>> @@ -99,7 +104,7 @@ static int deactivate_urbs(struct snd_usb_substream *subs, int force, int can_sl
>> */
>> static void release_urb_ctx(struct snd_urb_ctx *u)
>> {
>> - if (u->urb) {
>> + if (!u || u->urb) {
>> if (u->buffer_size)
>
> This will lead to Oops when u == NULL, no?
Yes, that's right. That said, it seems this hunk can be removed
entirely. I'll fix this in the next version.
>> +/* determine the number of frames in the next packet */
>> +static int next_packet_size(struct snd_usb_endpoint *ep)
>> +{
>> + unsigned long flags;
>> +
>> + if (ep->fill_max)
>> + return ep->maxframesize;
>> +
>> + spin_lock_irqsave(&ep->lock, flags);
>> + ep->phase = (ep->phase & 0xffff)
>> + + (ep->freqm << ep->datainterval);
>> + spin_unlock_irqrestore(&ep->lock, flags);
>> +
>> + return min(ep->phase >> 16, ep->maxframesize);
>
> If you need a protection here, safer to cover until min(), I guess.
Ok, will do.
I'll wait with a new version until there's feedback from people who
tested the code on their hardware :)
Thanks for the review.
Daniel
More information about the Alsa-devel
mailing list