From: Daniel Mack <zonque@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: blablack@gmail.com, alsa-devel@alsa-project.org,
clemens@ladisch.de, gdiffey@gmail.com, linuxaudio@showlabor.de
Subject: Re: [PATCH 2/5] ALSA: snd-usb: implement new endpoint streaming model
Date: Tue, 20 Dec 2011 21:08:01 +0100 [thread overview]
Message-ID: <4EF0EB21.1050605@gmail.com> (raw)
In-Reply-To: <s5hehvzgsfx.wl%tiwai@suse.de>
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
next prev parent reply other threads:[~2011-12-20 20:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 9:48 [PATCH 0/5] snd-usb endpoint rework, take 4 Daniel Mack
2011-12-20 9:48 ` [PATCH 1/5] ALSA: snd-usb: add snd_usb_audio-wide mutex Daniel Mack
2011-12-20 9:48 ` [PATCH 2/5] ALSA: snd-usb: implement new endpoint streaming model Daniel Mack
2011-12-20 15:08 ` Takashi Iwai
2011-12-20 15:32 ` Clemens Ladisch
2011-12-20 20:16 ` Daniel Mack
2011-12-20 15:42 ` Takashi Iwai
2011-12-20 20:08 ` Daniel Mack [this message]
2011-12-20 9:48 ` [PATCH 3/5] ALSA: snd-usb: switch over to new endpoint streaming logic Daniel Mack
2011-12-20 9:48 ` [PATCH 4/5] ALSA: snd-usb: remove old " Daniel Mack
2011-12-20 9:48 ` [PATCH 5/5] ALSA: snd-usb: add support for implicit feedback Daniel Mack
-- strict thread matches above, loose matches on Subject: below --
2011-12-20 23:34 [PATCH 0/5] snd-usb endpoint rework, take 5 Daniel Mack
2011-12-20 23:34 ` [PATCH 2/5] ALSA: snd-usb: implement new endpoint streaming model Daniel Mack
2011-12-21 16:16 ` Aurélien Leblond
2011-12-21 16:34 ` Daniel Mack
2011-12-21 17:11 ` Aurélien Leblond
2011-12-21 17:18 ` Daniel Mack
2011-12-22 17:55 ` Aurélien Leblond
2011-12-22 19:04 ` Daniel Mack
2011-12-18 23:02 [PATCH 0/5] snd-usb endpoint logic rework, version 3 Daniel Mack
2011-12-18 23:02 ` [PATCH 2/5] ALSA: snd-usb: implement new endpoint streaming model Daniel Mack
2011-11-18 20:05 [PATCH 0/5] RFC v2 for snd-usb endpoint logic rework Daniel Mack
2011-11-18 20:05 ` [PATCH 2/5] ALSA: snd-usb: implement new endpoint streaming model Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EF0EB21.1050605@gmail.com \
--to=zonque@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=blablack@gmail.com \
--cc=clemens@ladisch.de \
--cc=gdiffey@gmail.com \
--cc=linuxaudio@showlabor.de \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).