Skip to main content

request_into_buf

Function request_into_buf 

Source
pub fn request_into_buf(name: &CStr, dev: &Device, buf: &mut [u8]) -> Result
Expand description

Load firmware directly into the caller-provided buf.

On success the firmware image has been copied into buf; the caller accesses the data through buf itself.

This is intentionally a stand-alone function rather than a Firmware constructor. For the into_buf path, the firmware data lives in the caller’s buf, not in a kernel-owned buffer, so returning a Firmware would expose Firmware::data() as a second handle aliasing buf (and release_firmware() does not free buf anyway).