Re: [PATCH] devres: WARN() and return, don't crash on device_del()of uninitialized device

From: Benjamin Herrenschmidt
Date: Tue May 26 2009 - 18:26:18 EST


On Tue, 2009-05-26 at 14:15 -0700, Andrew Morton wrote:
>
> This could be coded a little more neatly as:
>
> /* Looks like an uninitialized device structure */
> if (WARN_ON(dev->devres_head.next == NULL))
> return -ENODEV;

Oh I didn't know we could do that nowadays...

Cheers,
Ben.


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