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

(cherry picked from commit e2e956828caf2f1db308d54b264c277c0abc25df)

Details

Provenance
rilysh <nightquick@proton.me>Authored on Jan 8 2024, 6:06 AM
markjCommitted on Jan 25 2024, 2:57 PM
Parents
rG777bac8888f3: net80211: Fix a typo in a source code comment
Branches
Unknown
Tags
Unknown