platform_external_dtc/tests/test_label_ref.dts
Stephen Boyd 3b9c97093d dtc: Fix NULL pointer use in dtlabel + dtref case
If we have a construct like this:

	label: &handle {
		...
	};

Running dtc on it will cause a segfault, because we use 'target'
when it could be NULL. Move the add_label() call into the if
statement to fix this potentially bad use of a NULL pointer.

Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-31 09:50:22 +11:00

9 lines
41 B
Text

/dts-v1/;
/ {
};
label: &handle {
};