Char/Misc driver fix for 3.17-rc5

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.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlQTOR4ACgkQMUfUDdst+ylXvACeKk2PemIzfaUoGTmgkGoOioX4
 BIsAoLE2jr9/ivh9r+0hkudNGnmBzVI4
 =PSdY
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2014-09-12 12:00:49 -07:00
commit 471cff7c42
1 changed files with 5 additions and 0 deletions

View 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;