We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 186412a commit 0154f59Copy full SHA for 0154f59
src/kernel/mm/physical_alloc.c
@@ -170,7 +170,8 @@ void mm_init_physical(struct devicetree_node *devicetree) {
170
child != &devicetree->children; child = child->next) {
171
struct devicetree_node *node =
172
container_of(child, struct devicetree_node, parent_children_head);
173
- if (strlen(node->name) < 7 || memcmp(node->name, "memory@", 7))
+ if (strlen(node->name) < sizeof("memory@") - 1 ||
174
+ memcmp(node->name, "memory@", sizeof("memory@") - 1))
175
continue;
176
177
// Run consider_physical_memory() on each one's reg property.
0 commit comments