提交 0f8d7ccc 编写于 作者: L Luis Chamberlain 提交者: Greg Kroah-Hartman

firmware_loader: add a sanity check for firmware_request_builtin()

Right now firmware_request_builtin() is used internally only
and so we have control over the callers. But if we want to expose
that API more broadly we should ensure the firmware pointer
is valid.

This doesn't fix any known issue, it just prepares us to later
expose this API to other users.
Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210917182226.3532898-4-mcgrof@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7c4fd907
......@@ -115,6 +115,9 @@ static bool firmware_request_builtin(struct firmware *fw, const char *name)
{
struct builtin_fw *b_fw;
if (!fw)
return false;
for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) {
if (strcmp(name, b_fw->name) == 0) {
fw->size = b_fw->size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册