Page MenuHomeFreeBSD

stand: Use calloc instead of malloc for initialization of filesystem devsw
ClosedPublic

Authored by audrey_rhelmot.io on Apr 8 2025, 1:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 8, 9:47 PM
Unknown Object (File)
Sun, Apr 5, 9:02 AM
Unknown Object (File)
Fri, Apr 3, 5:57 PM
Unknown Object (File)
Thu, Mar 26, 11:12 PM
Unknown Object (File)
Tue, Mar 17, 4:06 AM
Unknown Object (File)
Thu, Mar 12, 2:34 PM
Unknown Object (File)
Thu, Mar 12, 6:23 AM
Unknown Object (File)
Mar 10 2026, 6:07 AM
Subscribers

Details

Summary

This change is required for https://reviews.freebsd.org/D49355, so that we can check if d_dev is uninitialized by checking if it's NULL.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Nice refactor! Thanks!

This revision is now accepted and ready to land.Apr 8 2025, 3:02 AM

Oh! I should have committed this ages ago.
Still need to look more closely at the label patch. Love the concept, unsure about a couple of details.

Hmm ...
Sorry to be picky here .. but if you look at the calloc(3) manpage:
void *calloc(size_t number, size_t size);

The number comes first, then the size, so those should all have been calloc(1, sizeof(struct XXX))