Bug 256390 - [PATCH] boot loader: Fix __elfN(loadimage) return value
Summary: [PATCH] boot loader: Fix __elfN(loadimage) return value
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-02 20:00 UTC by David Sebek
Modified: 2021-06-06 20:46 UTC (History)
1 user (show)

See Also:


Attachments
[PATCH] boot loader: Fix __elfN(loadimage) return value (1.01 KB, patch)
2021-06-02 20:00 UTC, David Sebek
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Sebek 2021-06-02 20:00:47 UTC
Created attachment 225510 [details]
[PATCH] boot loader: Fix __elfN(loadimage) return value

Caller functions expect __elfN(loadimage) to return
a value of zero on failure and the file size on success.
Returning ENOENT on failure does not seem correct to me.
Comment 1 Mark Johnston freebsd_committer 2021-06-04 22:26:13 UTC
Thanks, I'll commit this patch.
Comment 2 commit-hook freebsd_committer 2021-06-06 20:45:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1ea87e2a70c31454a8696ab2979d13d21c5575d2

commit 1ea87e2a70c31454a8696ab2979d13d21c5575d2
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-06-06 20:40:25 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-06 20:44:46 +0000

    stand: Fix __elfN(loadimage) return value

    Caller functions expect __elfN(loadimage) to return a value of zero on
    failure and the file size on success.

    PR:             256390
    Reviewed by:    markj
    MFC after:      2 weeks

 stand/common/load_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)