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 <[email protected]>
Signed-off-by: David Gibson <[email protected]>
3 files changed