firmware_loader: add a sanity check for firmware_request_builtin()
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 17 Sep 2021 18:22:15 +0000 (11:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 14:26:49 +0000 (16:26 +0200)
commit0f8d7ccc2eab3e2ef39e49002e23e9677896715a
treeed70bbb01e0695a1d92f81be465390862707bb96
parent7c4fd90741b724b199089869262862542a8f026b
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: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210917182226.3532898-4-mcgrof@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_loader/main.c