Re: [External] Re: [PATCH v2 5/8] usb: mausb_host: Introduce PAL processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux