diff options
author | Kees Cook <keescook@chromium.org> | 2016-02-04 22:15:02 +0100 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2016-02-18 23:14:01 +0100 |
commit | 4b2530d819e179ae3352c38a1ceff929a922d070 (patch) | |
tree | 5a2418b846be2d02fd3741047aaabec9c9d932e9 | |
parent | firmware: move completing fw into a helper (diff) | |
download | linux-4b2530d819e179ae3352c38a1ceff929a922d070.tar.xz linux-4b2530d819e179ae3352c38a1ceff929a922d070.zip |
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>
-rw-r--r-- | drivers/base/firmware_class.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 7bc4ad0f36d5..c743a2f18c33 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -361,19 +361,17 @@ static int fw_get_filesystem_firmware(struct device *device, continue; rc = fw_read_file_contents(file, buf); fput(file); - if (rc) + if (rc) { dev_warn(device, "loading %s failed with error %d\n", path, rc); - else - break; - } - __putname(path); - - if (!rc) { + continue; + } dev_dbg(device, "direct-loading %s\n", buf->fw_id); fw_finish_direct_load(device, buf); + break; } + __putname(path); return rc; } |