Re: [PATCH V2] ALS: TSL2550 driver move from i2c/chips

From: Frederic Weisbecker
Date: Sat Oct 17 2009 - 13:07:31 EST


On Sat, Oct 17, 2009 at 05:56:48PM +0100, Jonathan Cameron wrote:
> +static int tsl2550_get_id(void)
> +{
> + int ret, val;
> +
> +idr_again:
> + if (unlikely(idr_pre_get(&tsl2550_idr, GFP_KERNEL) == 0))
> + return -ENOMEM;
> + spin_lock(&tsl2550_idr_lock);
> + ret = idr_get_new(&tsl2550_idr, NULL, &val);
> + if (unlikely(ret == -EAGAIN))
> + goto idr_again;



That looks like a fair chance to produce a deadlock
by reacquiring the above spinlock.

Also I never see the above lock released later from this
function or its caller.

--
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/