firmware: use 'kernel_read()' to read firmware into kernel buffer
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 4 Oct 2012 16:19:02 +0000 (09:19 -0700)
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Mon, 25 Apr 2016 01:52:57 +0000 (01:52 +0000)
commit2d0f461df45b4e45bcb4008fe5cfa77c1231d2d3
treefcb4e9d3e41efc62864306c0ada721e7219d8117
parenta168da208a9533d820270f4534790619f0ee3b42
firmware: use 'kernel_read()' to read firmware into kernel buffer

Fengguang correctly points out that the firmware reading should not use
vfs_read(), since the buffer is in kernel space.

The vfs_read() just happened to work for kernel threads, but sparse
warns about the incorrect address spaces, and it's definitely incorrect
and could fail for other users of the firmware loading.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/base/firmware_class.c