Page MenuHomeFreeBSD

Fix booting on arm64
ClosedPublic

Authored by andrew on Jan 15 2018, 2:18 PM.
Tags
None
Referenced Files
F105829350: D13915.id37968.diff
Sat, Dec 21, 8:44 AM
F105823215: D13915.diff
Sat, Dec 21, 6:08 AM
Unknown Object (File)
Wed, Nov 27, 10:44 AM
Unknown Object (File)
Wed, Nov 27, 5:55 AM
Unknown Object (File)
Fri, Nov 22, 8:26 AM
Unknown Object (File)
Nov 20 2024, 8:39 PM
Unknown Object (File)
Nov 17 2024, 12:54 AM
Unknown Object (File)
Nov 11 2024, 2:54 PM
Subscribers
None

Details

Summary

Fix booting on some arm64 systems after r327879 by fixing the call to
utf8_to_ucs2 in boot1.efi. We need to initialise the ucs2 output string
so it will allocate space, and use the return value to determine if the
call was successful.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14379
Build 14534: arc lint + arc unit

Event Timeline

imp added inline comments.
stand/efi/boot1/boot1.c
93

Why isn't testing uv == NULL sufficient? We always don't change it when there's an error. The bug here is that uv wasn't initialized to NULL like efi_setenv_freebsd_wcs was.

109–111

We have the same code here.

This revision is now accepted and ready to land.Jan 15 2018, 3:49 PM
stand/efi/boot1/boot1.c
93

It's allocated at the start of utf8_to_ucs2. I don't see where it's then set to NULL.

109–111

That also looks wrong, however as utf8_to_ucs2 only seems to fail when the input string is bad I think the error case in either function is unlikely.

stand/efi/boot1/boot1.c
93

Yea, you're right.... Other code I've written sets it to null and I'd assumed this did too. It should, but doesn't, so this check is right.

109–111

We should do the same check here of the return value.

See also https://reviews.freebsd.org/D13917, but I think checking the return values is better in both places.

This revision was automatically updated to reflect the committed changes.