HomeFreeBSD

bhyve: return ENOMEM instead of EFAULT and call free() after being used

Description

bhyve: return ENOMEM instead of EFAULT and call free() after being used

  1. In basl_load() function, when allocation fails,

it returns an EFAULT instead of ENOMEM. An EFAULT
can mislead in some scenarios, whereas an ENOMEM
for an allocation function makes much more sense.

  1. Call free() on addr, as it's not being used

anymore after the basl_table_append_bytes()
function.

Signed-off-by: rilysh <nightquick@proton.me>

MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1016

Details

Provenance
rilysh <nightquick@proton.me>Authored on Jan 8 2024, 6:06 AM
markjCommitted on Jan 16 2024, 2:39 PM
Parents
rG9b20849bc5f1: md5: Enter capability mode earlier
Branches
Unknown
Tags
Unknown