]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 4 Oct 2012 16:19:02 +0000 (09:19 -0700)
commit3f662a7b5c33ce27a901a320f55f456dc009f0c7
tree7ab6b29e6b0013519f3418bbaf8f661e064861ba
parentcbe24c608952eec681949b7c786b853d620cd942
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