提交 4b2530d8 编写于 作者: K Kees Cook 提交者: Mimi Zohar

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: NKees Cook <keescook@chromium.org>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Cc: David Howells <dhowells@redhat.com>
Acked-by: NLuis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
上级 5275d194
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册