* [PATCH] Lattice ECP3 FPGA: Check firmware pointer
@ 2014-08-05 16:19 jean-michel.hautbois
2014-08-05 16:22 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: jean-michel.hautbois @ 2014-08-05 16:19 UTC (permalink / raw)
To: linux-kernel, gregkh, arnd; +Cc: jhautbois, Jean-Michel Hautbois
From: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
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 <jean-michel.hautbois@vodalys.com>
---
drivers/misc/lattice-ecp3-config.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c
index 7ffdb58..7e1efd5 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)
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;
--
2.0.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Lattice ECP3 FPGA: Check firmware pointer
2014-08-05 16:19 [PATCH] Lattice ECP3 FPGA: Check firmware pointer jean-michel.hautbois
@ 2014-08-05 16:22 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-08-05 16:22 UTC (permalink / raw)
To: jean-michel.hautbois; +Cc: linux-kernel, gregkh, arnd, jhautbois
At Tue, 5 Aug 2014 18:19:37 +0200,
jean-michel.hautbois@vodalys.com wrote:
>
> From: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
>
> 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 <jean-michel.hautbois@vodalys.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Takashi
> ---
> drivers/misc/lattice-ecp3-config.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c
> index 7ffdb58..7e1efd5 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)
> 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;
> --
> 2.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-05 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 16:19 [PATCH] Lattice ECP3 FPGA: Check firmware pointer jean-michel.hautbois
2014-08-05 16:22 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®