Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32861 )
Change subject: device_tree: Switch allocations to xzalloc() ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/32861/5/src/lib/device_tree.c File src/lib/device_tree.c:
https://review.coreboot.org/#/c/32861/5/src/lib/device_tree.c@510 PS5, Line 510: malloc
ok, I can understand that most malloc() here should be xzalloc intead of xmalloc. […]
There's no great reason for this one, it's just that depthcharge did it this way and I didn't want to diverge the code unnecessarily (in case we want to pick over more patches later). I think the main point is that we don't have an xstrdup(), so we need to have cases that return NULL for failure anyway, and then you might as well do it for the other allocation in the same function.