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
Unified · Split
| @@ -79,6 +79,11 @@ static void firmware_load(const struct firmware *fw, void *context) · 78 unmodified lines | ||
| 79 | 79 | u32 jedec_id; |
| 80 | 80 | u32 status; |
| 81 | 81 | |
| 82 | + if (fw == NULL) { | |
| 83 | + dev_err(&spi->dev, "Cannot load firmware, aborting\n"); | |
| 84 | + return; | |
| 85 | + } | |
| 86 | + | |
| 82 | 87 | if (fw->size == 0) { |
| 83 | 88 | dev_err(&spi->dev, "Error: Firmware size is 0!\n"); |
| 84 | 89 | return; |