firmware: check for file truncation on direct firmware loading
authorLuis R. Rodriguez <mcgrof@suse.com>
Tue, 12 May 2015 21:49:41 +0000 (14:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 19:36:34 +0000 (12:36 -0700)
commit1ba4de17e0cb9cc3e03ce5b1fafebdd01c48c1f2
treeda801efb3c2e146afbba27de9eb59274b3836b8b
parentf5727b05d221796baf69667ed5c891d4bd53711e
firmware: check for file truncation on direct firmware loading

When direct firmware loading is used we iterate over a list
of possible firmware paths and concatenate the desired firmware
name with each path and look for the file there. Should the
passed firmware name be too long we end up truncating the
file we want to look for, the search however is still done.
Add a check for truncation instead of looking for a
truncated firmware filename.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: David Howells <dhowells@redhat.com>
Cc: Kyle McMartin <kyle@kernel.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_class.c