size_t offset, u32 opt_flags)
{
struct firmware *fw = NULL;
- struct cred *kern_cred = NULL;
- const struct cred *old_cred;
bool nondirect = false;
int ret;
if (ret <= 0) /* error or already assigned */
goto out;
- /*
- * We are about to try to access the firmware file. Because we may have been
- * called by a driver when serving an unrelated request from userland, we use
- * the kernel credentials to read the file.
- */
- kern_cred = prepare_kernel_cred(NULL);
- if (!kern_cred) {
- ret = -ENOMEM;
- goto out;
- }
- old_cred = override_creds(kern_cred);
-
ret = fw_get_filesystem_firmware(device, fw->priv, "", NULL);
/* Only full reads can support decompression, platform, and sysfs. */
} else
ret = assign_fw(fw, device);
- revert_creds(old_cred);
-
out:
if (ret < 0) {
fw_abort_batch_reqs(fw);