Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is actually invalid, causing boot to fail
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 3579 Build 3619: arc lint + arc unit
Event Timeline
sys/boot/i386/libi386/biosdisk.c | ||
---|---|---|
749 | since bd structure is already having bd_sectorsize member, I would suggest to use bd_sectorsize here and below and avoid hardcoded constant; this will help to get ready for non-512B sector disks. | |
769 | bd_io() is returning -1 in case of error, I would keep the same logic, maybe also set errno to ENOMEM. |
Comment Actions
Updated with feedback from tsoome
Updating D6213: Fixup the geliboot sector round code
Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect
Also, replace alloca() with malloc() because alloca() can return an allocation that is...