Subject: [PATCH 1/1] regulator: gpio-regulator: fix crash when no states property in dt

From: [email-masked] (Mark Brown)
Date: Fri, 9 Nov 2012 16:56:09 +0000

On Fri, Nov 09, 2012 at 04:34:36PM +0800, Frank Li wrote:

>  	/* Fetch states. */
>  	prop = of_find_property(np, "states", NULL);
> -	proplen = prop->length / sizeof(int);
> +	proplen = prop ? prop->length / sizeof(int) : 0;

Aren't states mandatory for this driver, in which case shouldn't the
probe fail here?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121109/32576d25/attachment.sig>