Re: em38xx locking question

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

 



On 03/10/2015 02:18 PM, Ezequiel Garcia wrote:
> Mauro,
> 
> Function drivers/media/usb/em28xx/em28xx-video.c:get_next_buf
> (copy pasted below for reference) does not take the list spinlock,
> yet it modifies the list. Is that correct?

That looks wrong to me. You really need spinlocks here.

Regards,

	Hans

> 
> static inline struct em28xx_buffer *get_next_buf(struct em28xx *dev,
>                                                  struct em28xx_dmaqueue *dma_q)
> {
>         struct em28xx_buffer *buf;
> 
>         if (list_empty(&dma_q->active)) {
>                 em28xx_isocdbg("No active queue to serve\n");
>                 return NULL;
>         }
>  
>         /* Get the next buffer */
>         buf = list_entry(dma_q->active.next, struct em28xx_buffer, list);
>         /* Cleans up buffer - Useful for testing for frame/URB loss */
>         list_del(&buf->list);
>         buf->pos = 0; 
>         buf->vb_buf = buf->mem;
>  
>         return buf;
> }
> 
> Thanks!
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux