fetch_settings_copy() currently returns success and a NULL data pointer to indicate a non-existent setting. This is intended to allow the caller to differentiate between a non-existent setting and an error in allocating memory for the copy of the setting. The underlying settings blocks' fetch() methods provide no way to perform an existence check separate from an attempt to fetch the setting. A "non-existent setting" therefore means simply a setting for which an error was encountered when attempting to fetch from every settings block within the subtree. Since any underlying error within a settings block (e.g. a GuestRPC failure when attempting to retrieve a VMware GuestInfo setting) will produce the effect of a "non-existent setting", it seems somewhat meaningless to give special treatment to memory allocation errors within fetch_setting_copy(). Remove the special treatment and simplify the semantics of fetch_setting_copy() by directly passing through any underlying error (including non-existence) encountered while fetching the setting. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
||
722 | 722 |
|
723 | 723 |
|
724 | 724 |
|
725 |
|
|
726 |
|
|
727 |
|
|
728 |
|
|
729 |
|
|
730 | 725 |
|
731 | 726 |
|
732 | 727 |
|
|
||
736 | 731 |
|
737 | 732 |
|
738 | 733 |
|
739 |
|
|
734 |
|
|
740 | 735 |
|
741 | 736 |
|
742 |
|
|
737 |
|
|
743 | 738 |
|
744 | 739 |
|
745 | 740 |
|
|
||
1055 | 1050 |
|
1056 | 1051 |
|
1057 | 1052 |
|
1058 |
|
|
1059 |
|
|
1060 |
|
|
1061 |
|
|
1062 |
|
|
1063 |
|
|
1064 | 1053 |
|
1065 | 1054 |
|
1066 | 1055 |
|
|
||
1071 | 1060 |
|
1072 | 1061 |
|
1073 | 1062 |
|
1074 |
|
|
1075 | 1063 |
|
1076 | 1064 |
|
1077 | 1065 |
|
|
||
116 | 116 |
|
117 | 117 |
|
118 | 118 |
|
119 |
|
|
120 | 119 |
|
121 | 120 |
|
122 | 121 |
|
|
||
129 | 128 |
|
130 | 129 |
|
131 | 130 |
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
131 |
|
|
132 |
|
|
140 | 133 |
|
141 | 134 |
|
142 | 135 |
|
|
||
147 | 140 |
|
148 | 141 |
|
149 | 142 |
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
143 |
|
|
144 |
|
|
158 | 145 |
|
159 | 146 |
|
160 | 147 |
|
|
||
91 | 91 |
|
92 | 92 |
|
93 | 93 |
|
94 |
|
|
95 | 94 |
|
96 | 95 |
|
97 | 96 |
|
|
||
101 | 100 |
|
102 | 101 |
|
103 | 102 |
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
103 |
|
|
104 |
|
|
119 | 105 |
|
120 | 106 |
|
121 | 107 |
|