File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,8 @@ static struct xbc_node * __init xbc_add_sibling(char *data, u32 flag)
373
373
sib -> next = xbc_node_index (node );
374
374
}
375
375
}
376
- }
376
+ } else
377
+ xbc_parse_error ("Too many nodes" , data );
377
378
378
379
return node ;
379
380
}
@@ -657,8 +658,10 @@ static int __init xbc_verify_tree(void)
657
658
struct xbc_node * n , * m ;
658
659
659
660
/* Empty tree */
660
- if (xbc_node_num == 0 )
661
+ if (xbc_node_num == 0 ) {
662
+ xbc_parse_error ("Empty config" , xbc_data );
661
663
return - ENOENT ;
664
+ }
662
665
663
666
for (i = 0 ; i < xbc_node_num ; i ++ ) {
664
667
if (xbc_nodes [i ].next > xbc_node_num ) {
@@ -732,12 +735,17 @@ int __init xbc_init(char *buf)
732
735
char * p , * q ;
733
736
int ret , c ;
734
737
735
- if (xbc_data )
738
+ if (xbc_data ) {
739
+ pr_err ("Error: bootconfig is already initialized.\n" );
736
740
return - EBUSY ;
741
+ }
737
742
738
743
ret = strlen (buf );
739
- if (ret > XBC_DATA_MAX - 1 || ret == 0 )
744
+ if (ret > XBC_DATA_MAX - 1 || ret == 0 ) {
745
+ pr_err ("Error: Config data is %s.\n" ,
746
+ ret ? "too big" : "empty" );
740
747
return - ERANGE ;
748
+ }
741
749
742
750
xbc_data = buf ;
743
751
xbc_data_size = ret + 1 ;
You can’t perform that action at this time.
0 commit comments