Re: [BUG] cdev_put() race condition

From: Greg KH
Date: Wed Dec 17 2008 - 13:18:02 EST


On Wed, Dec 17, 2008 at 02:37:33PM +0100, Hans Verkuil wrote:
> > Again, don't use cdev's reference counting for your own object
> > lifecycle, it is different and will cause problems, like you have found
> > out.
>
> Sigh. It has nothing to do with how v4l uses it. And to demonstrate this,
> here is how you reproduce it with the sg module (tested it with my USB
> harddisk).
>
> 1) apply this patch to char_dev.c:

<snip>

Ok, since I can't convince you that using a cdev for your reference
counting is incorrect, I'll have to go change the cdev code to prevent
you from doing this :(

Anyway, do you have a patch for the cdev code to propose how to fix this
issue you are having?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/