summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-12 12:00:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-12 12:00:49 -0700
commit471cff7c42b56dbbd69003c25bbd97cf6776d464 (patch)
tree11fcc235638570e0013ba341498644c8bff76a04
parenta6988b334398513fbb423d66f1b85d0909f53d24 (diff)
parent3f0d97d97f2b539cf9ac746be4ec097259e6a8d0 (diff)
Merge tag 'char-misc-3.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fix from Greg KH: "Here is one misc driver fix for 3.17-rc5. It resolves a kernel oops that can happen in the lattice FPGA driver if the firmware isn't present on the system. It's been in the linux-next tree for a while now" * tag 'char-misc-3.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: Lattice ECP3 FPGA: Check firmware pointer
-rw-r--r--drivers/misc/lattice-ecp3-config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c
index 7ffdb589841e..7e1efd5f58f0 100644
--- a/drivers/misc/lattice-ecp3-config.c
+++ b/drivers/misc/lattice-ecp3-config.c
@@ -79,6 +79,11 @@ static void firmware_load(const struct firmware *fw, void *context)
u32 jedec_id;
u32 status;
+ if (fw == NULL) {
+ dev_err(&spi->dev, "Cannot load firmware, aborting\n");
+ return;
+ }
+
if (fw->size == 0) {
dev_err(&spi->dev, "Error: Firmware size is 0!\n");
return;