lkml.org 
[lkml]   [2020]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [External] Re: [PATCH v2 5/8] usb: mausb_host: Introduce PAL processing
Date
On 26.2.20. 13:35, Oliver Neukum wrote:
> Am Mittwoch, den 26.02.2020, 09:58 +0000 schrieb Vladimir Stankovic
>
> +int mausb_enqueue_event_from_user(u8 madev_addr, u16 num_of_events,
> + u16 num_of_completed)
> +{
> + unsigned long flags;
> + struct mausb_device *dev;
> +
> + spin_lock_irqsave(&mss.lock, flags);
>
> You save the flags.
>
> + dev = mausb_get_dev_from_addr_unsafe(madev_addr);
> +
> + if (!dev) {
> + spin_unlock_irqrestore(&mss.lock, flags);
> + return -EINVAL;
> + }
> +
> + spin_lock_irqsave(&dev->num_of_user_events_lock, flags);
>
> You overwrite the flags.
>
> + dev->num_of_user_events += num_of_events;
> + dev->num_of_completed_events += num_of_completed;
> + spin_unlock_irqrestore(&dev->num_of_user_events_lock, flags);
>
> Your restore the flags.
>
> + queue_work(dev->workq, &dev->work);
> + spin_unlock_irqrestore(&mss.lock, flags);
>
> You restore the overwritten flags.
>
> This cannot be right.
>
> Regards
> Oliver
>
You're right. We'll address this issue.

--
Regards,
Vladimir.
\
 
 \ /
  Last update: 2020-02-27 09:51    [W:0.062 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site