This patch adds a check to avoid freeing a null pointer in boot1. This was causing a boot loop on the Raspberry Pi 3.
Details
Details
- Reviewers
emaste - Commits
- rS325681: boot1: avoid using NULL device path
- build boot1.efi
- copy boot1 to the efi system partition
- boot system
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/boot/efi/boot1/boot1.c | ||
---|---|---|
414 ↗ | (On Diff #35052) | It's not necessary to initialize this to NULL because we set it on line 462. |
Comment Actions
Also for the commit message -- it's not freeing that we need to avoid, it's using the null pointer at all. free(NULL) is actually fine. it's the printf/setenv that we can't pass a NULL pointer to.
Comment Actions
This looks good for me. We don't need the = NULL, as emaste says. And the issue is printf'ing and setenv'ing the NULL data.
sys/boot/efi/boot1/boot1.c | ||
---|---|---|
464 ↗ | (On Diff #35052) | here's where using NULL is bad. One could argue that printf in libsa should emulate the normal userland printing of NULL data as <null>. It's only a little bit of code, but boot2 may make that tricky. |
sys/boot/efi/boot1/boot1.c | ||
---|---|---|
468 ↗ | (On Diff #35052) | This one also needs to be wrapped at 80 cols. |