Merge tag 'char-misc-3.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Sep 2014 19:00:49 +0000 (12:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Sep 2014 19:00:49 +0000 (12:00 -0700)
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

drivers/misc/lattice-ecp3-config.c

index 7ffdb589841ed2fe2e25ec2580218e4dfd07a2a2..7e1efd5f58f0b04ed8b303d142628755f56a72d7 100644 (file)
@@ -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;