mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
firmware: clean up filesystem load exit path
This makes the error and success paths more readable while trying to load firmware from the filesystem. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Josh Boyer <jwboyer@fedoraproject.org> Cc: David Howells <dhowells@redhat.com> Acked-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
This commit is contained in:
parent
5275d194e0
commit
4b2530d819
1 changed files with 5 additions and 7 deletions
|
@ -361,19 +361,17 @@ static int fw_get_filesystem_firmware(struct device *device,
|
||||||
continue;
|
continue;
|
||||||
rc = fw_read_file_contents(file, buf);
|
rc = fw_read_file_contents(file, buf);
|
||||||
fput(file);
|
fput(file);
|
||||||
if (rc)
|
if (rc) {
|
||||||
dev_warn(device, "loading %s failed with error %d\n",
|
dev_warn(device, "loading %s failed with error %d\n",
|
||||||
path, rc);
|
path, rc);
|
||||||
else
|
continue;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
__putname(path);
|
|
||||||
|
|
||||||
if (!rc) {
|
|
||||||
dev_dbg(device, "direct-loading %s\n",
|
dev_dbg(device, "direct-loading %s\n",
|
||||||
buf->fw_id);
|
buf->fw_id);
|
||||||
fw_finish_direct_load(device, buf);
|
fw_finish_direct_load(device, buf);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
__putname(path);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue