mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
firmware: fix __getname() missing failure check
The request_firmware*() APIs uses __getname() to iterate over the list of paths possible for firmware to be found, the code however never checked for failure on __getname(). Although *very unlikely*, this can still happen. Add the missing check. There is still no checks on the concatenation of the path and filename passed, that requires a bit more work and subsequent patches address this. The commit that introduced this isabb139e7("firmware: teach the kernel to load firmware files directly from the filesystem"). mcgrof@ergon ~/linux (git::firmware-fixes) $ git describe --containsabb139e7v3.7-rc1~120 Cc: Linus Torvalds <[email protected]> Cc: Ming Lei <[email protected]> Cc: Rusty Russell <[email protected]> Cc: David Howells <[email protected]> Cc: Kyle McMartin <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
f4445f8b20
commit
f5727b05d2
1 changed files with 5 additions and 1 deletions
|
|
@ -322,7 +322,11 @@ static int fw_get_filesystem_firmware(struct device *device,
|
|||
{
|
||||
int i;
|
||||
int rc = -ENOENT;
|
||||
char *path = __getname();
|
||||
char *path;
|
||||
|
||||
path = __getname();
|
||||
if (!path)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(fw_path); i++) {
|
||||
struct file *file;
|
||||
|
|
|
|||
Loading…
Reference in a new issue