aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2015-03-20 17:36:33 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-26 14:21:52 +1100
commitff8f5d2da154d447da48b14e99bad4ecf3694f78 (patch)
tree58d3b28e52da1ae08f638aff63344d0d18ed1b50 /hw
parentcfd735d6747bbaa475327f351e1d7f8ddea4c24c (diff)
downloadskiboot-ff8f5d2da154d447da48b14e99bad4ecf3694f78.zip
skiboot-ff8f5d2da154d447da48b14e99bad4ecf3694f78.tar.gz
skiboot-ff8f5d2da154d447da48b14e99bad4ecf3694f78.tar.bz2
FSP/LED: Validate before creating LED nodesskiboot-5.0-rc1
If FSP messes up SLCA data then attention location code points to some other location code and its possible that we may endup in duplicate LED location code :-( Better to continue with partial LED list than crashing OPAL because of duplicate node in device tree. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: prlog(PR_WARNING) on duplicate found] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/fsp/fsp-leds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index dd6cacf..c9dc70a 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -1319,6 +1319,13 @@ void create_led_device_nodes(void)
/* LED child nodes */
list_for_each_safe(&cec_ledq, led, next, link) {
+ /* Duplicate LED location code */
+ if (dt_find_by_path(pled, led->loc_code)) {
+ prlog(PR_WARNING, PREFIX "duplicate location code %s",
+ led->loc_code);
+ continue;
+ }
+
cled = dt_new(pled, led->loc_code);
if (!cled) {
prlog(PR_WARNING, PREFIX