File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,10 @@ static FAR struct pci_bus_s *pci_alloc_bus(void)
556
556
FAR struct pci_bus_s * bus ;
557
557
558
558
bus = kmm_zalloc (sizeof (* bus ));
559
+ if (bus == NULL )
560
+ {
561
+ return NULL ;
562
+ }
559
563
560
564
list_initialize (& bus -> node );
561
565
list_initialize (& bus -> children );
@@ -580,6 +584,10 @@ static FAR struct pci_device_s *pci_alloc_device(void)
580
584
FAR struct pci_device_s * dev ;
581
585
582
586
dev = kmm_zalloc (sizeof (* dev ));
587
+ if (dev == NULL )
588
+ {
589
+ return NULL ;
590
+ }
583
591
584
592
list_initialize (& dev -> node );
585
593
list_initialize (& dev -> bus_list );
@@ -2069,6 +2077,11 @@ int pci_register_controller(FAR struct pci_controller_s *ctrl)
2069
2077
}
2070
2078
2071
2079
bus = pci_alloc_bus ();
2080
+ if (bus == NULL )
2081
+ {
2082
+ return - ENOMEM ;
2083
+ }
2084
+
2072
2085
bus -> ctrl = ctrl ;
2073
2086
2074
2087
ctrl -> bus = bus ;
You can’t perform that action at this time.
0 commit comments