| Summary: | Code to malloc should use struct <NAME> instead of pointer as per style guidelines | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Shawn Debnath <sd> | ||||
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed Not A Bug | ||||||
| Severity: | Affects Many People | ||||||
| Priority: | --- | ||||||
| Version: | CURRENT | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Better to use variable to obtain size to allocate so that in the future if variable type changes, compiler's won't produce warnings and harder to track down. |
Created attachment 170020 [details] Patch for malloc using struct In efipart.c, the code to malloc the phys dev info (struct pdinfo) is allocated via: malloc(nin * sizeof(*pdinfo)); It should be malloc(nin * sizeof(struct pdinfo)); according to style(9) and in general code guidelines in FreeBSD