Re: sn9c10x list corruption in 2.6.18.1

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

 



Hello Dave.

> I found one area in the driver where we do list manipulation without any locking,
> but I'm not entirely convinced that this is the source of the bug yet.

Spinlocks are not necessary there, becouse that piece of code is already
isolated when running, to prevent concurrent accesses to the list from within 
the irq handler. The bug should be elsewhere (probably not in the driver).

Best regards
Luca


> > --- linux-2.6.18.noarch/drivers/media/video/sn9c102/sn9c102_core.c~	2006-10-21 22:57:32.000000000 -0400
> +++ linux-2.6.18.noarch/drivers/media/video/sn9c102/sn9c102_core.c	2006-10-21 22:58:43.000000000 -0400
> @@ -197,13 +197,16 @@ static void sn9c102_empty_framequeues(st
>  static void sn9c102_requeue_outqueue(struct sn9c102_device* cam)
>  {
>  	struct sn9c102_frame_t *i;
> +	unsigned long lock_flags;
>  
> +	spin_lock_irqsave(&cam->queue_lock, lock_flags);
>  	list_for_each_entry(i, &cam->outqueue, frame) {
>  		i->state = F_QUEUED;
>  		list_add(&i->frame, &cam->inqueue);
>  	}
>  
>  	INIT_LIST_HEAD(&cam->outqueue);
> +	spin_unlock_irqrestore(&cam->queue_lock, lock_flags);
>  }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux