Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1550577

[PATCH] firmware: Prevent oops on delayed abort

From Chris Wilson <chris@chris-wilson.co.uk>
Newsgroups linux.kernel
Subject [PATCH] firmware: Prevent oops on delayed abort
Date 2017-01-04 10:40 +0100
Message-ID <sVQd4-2M8-31@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


If the firmware load is slow and cancelled, we may call fw_load_abort()
twice and promptly oops on the second with a NULL dereference.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/firmware_class.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 4497d263209f..d03e21c1d2f3 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -557,6 +557,9 @@ static void fw_load_abort(struct firmware_priv *fw_priv)
 {
 	struct firmware_buf *buf = fw_priv->buf;
 
+	if (!buf)
+		return;
+
 	__fw_load_abort(buf);
 
 	/* avoid user action after loading abort */
-- 
2.11.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] firmware: Prevent oops on delayed abort Chris Wilson <chris@chris-wilson.co.uk> - 2017-01-04 10:40 +0100
  Re: [PATCH] firmware: Prevent oops on delayed abort Ming Lei <ming.lei@canonical.com> - 2017-01-04 12:40 +0100
    Re: [PATCH] firmware: Prevent oops on delayed abort "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-01-04 16:50 +0100
      Re: [PATCH] firmware: Prevent oops on delayed abort Chris Wilson <chris@chris-wilson.co.uk> - 2017-01-04 17:10 +0100
        Re: [PATCH] firmware: Prevent oops on delayed abort "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-01-04 18:10 +0100

csiph-web