projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69e273c
)
Lattice ECP3 FPGA: Check firmware pointer
author
Jean-Michel Hautbois
<
[email protected]
>
Tue, 5 Aug 2014 16:19:37 +0000
(18:19 +0200)
committer
Greg Kroah-Hartman
<
[email protected]
>
Mon, 8 Sep 2014 21:38:14 +0000
(14:38 -0700)
This patch corrects a lack of testing.
If fw is NULL when calling firmware_load(), it results in a kernel oops.
Signed-off-by: Jean-Michel Hautbois <
[email protected]
>
Reviewed-by: Takashi Iwai <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/misc/lattice-ecp3-config.c
patch
|
blob
|
history
diff --git
a/drivers/misc/lattice-ecp3-config.c
b/drivers/misc/lattice-ecp3-config.c
index 7ffdb589841ed2fe2e25ec2580218e4dfd07a2a2..7e1efd5f58f0b04ed8b303d142628755f56a72d7 100644
(file)
--- 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;