opnsense-src/sys/compat
Enji Cooper a56073e4df LinuxKPI: firmware: remove enoentok logic in *firmware_request(..)
Prior to this change, in the event that a firmware module could not be
loaded, the linux_firmware driver would return a partially initialized
structure with uninitialized/zeroed out values for certain fields. Linux
does not do this, however, so some drivers that use
`request_firmware_nowait` expecting Linux behavior, like `if_bcrmfmac`,
would crash trying to dereference a NULL pointer.

This doesn't address the load/unload situation completely as the driver
remains loaded after the "firmware crashes", but it makes a completely
unusable situation (a kernel panic) into a slightly more usable situation
(driver does not unload).

As a sidenote: the raw free(9) call was replaced with a call to
`linuxkpi_release_firmware` because the latter call [better] ensures
that all resources allocated earlier on in the function are cleaned up.

MFC after:	1 weeks
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D58451

(cherry picked from commit ef947bb97302d8862545cd0a5f38b24fa1bae2f6)
2026-11-10 12:02:39 +01:00
..
freebsd32 kern/proc: expose reaper PID and subtree root in struct kinfo_proc 2026-04-27 04:28:59 +03:00
ia32 imgact: Mark brandinfo and note structures as const 2026-02-01 01:01:08 +08:00
lindebugfs lindebugfs: Pass user buffer pointers to the read/write file operations 2026-04-24 13:49:14 -04:00
linprocfs execve_block(): a mechanism for mutual exclusion with execve() on the process 2026-07-06 10:29:25 +02:00
linsysfs pseudofs: return errors from pfs_create_*() 2025-09-03 21:08:52 -05:00
linux execve_block(): a mechanism for mutual exclusion with execve() on the process 2026-07-06 10:29:25 +02:00
linuxkpi LinuxKPI: firmware: remove enoentok logic in *firmware_request(..) 2026-11-10 12:02:39 +01:00
x86bios Deprecate contigfree(9) in favour of free(9) 2024-07-26 10:45:01 +00:00