diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-12 15:00:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-12 15:00:49 -0400 |
commit | 471cff7c42b56dbbd69003c25bbd97cf6776d464 (patch) | |
tree | 11fcc235638570e0013ba341498644c8bff76a04 | |
parent | a6988b334398513fbb423d66f1b85d0909f53d24 (diff) | |
parent | 3f0d97d97f2b539cf9ac746be4ec097259e6a8d0 (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.c | 5 |
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) | |||
79 | u32 jedec_id; | 79 | u32 jedec_id; |
80 | u32 status; | 80 | u32 status; |
81 | 81 | ||
82 | if (fw == NULL) { | ||
83 | dev_err(&spi->dev, "Cannot load firmware, aborting\n"); | ||
84 | return; | ||
85 | } | ||
86 | |||
82 | if (fw->size == 0) { | 87 | if (fw->size == 0) { |
83 | dev_err(&spi->dev, "Error: Firmware size is 0!\n"); | 88 | dev_err(&spi->dev, "Error: Firmware size is 0!\n"); |
84 | return; | 89 | return; |