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, Nov 5, 12:30 AM
Unknown Object (File)
Sat, Nov 1, 6:23 PM
Unknown Object (File)
Thu, Oct 30, 4:41 PM
Unknown Object (File)
Thu, Oct 30, 10:58 AM
Unknown Object (File)
Sat, Oct 25, 7:36 PM
Unknown Object (File)
Fri, Oct 24, 7:09 AM
Unknown Object (File)
Wed, Oct 15, 11:44 PM
Unknown Object (File)
Oct 7 2025, 7:04 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))