[PATCH][OF] Add of_device_is_available function

Paul Mackerras paulus at samba.org
Tue Feb 26 20:04:12 EST 2008


Josh Boyer writes:

> +	status = of_get_property(device, "status", NULL);
> +	if (status == NULL)
> +		return 1;
> +
> +	if (!strcmp(status, "okay") || !strcmp(status, "ok"))

It would probably be good to defend against the possibility that the
property isn't null-terminated (for example if its length is zero).

Paul.



More information about the Linuxppc-dev mailing list