Files
Enji Cooper b165ec5e21 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 ef947bb973)
2026-10-31 18:22:56 -07:00
..
2023-10-09 06:24:31 +03:00
2026-08-05 15:15:15 +00:00