From: "Lucas C. Villa Real" <lucasvr@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Initialize pointer on request_firmware
Date: Wed, 21 Sep 2011 23:55:15 -0300 [thread overview]
Message-ID: <20110921235515.7476c5fe.lucasvr@gmail.com> (raw)
Hello, folks,
I've seen some kernel oopses when suspending my machine. The problem comes from isight_firmware, which assumes that, on error, a call to request_firmware() will initialize the provided pointer to the firmware image to NULL.
The patch below fixes the isight_firmware side of the problem and also ensures that request_firmware() always sets the pointer to NULL on such cases (it currently does that for all except one situation).
Signed-off-by: Lucas C. Villa Real <lucasvr@gobolinux.org>
--- linux-3.0.4/drivers/base/firmware_class.c.orig 2011-09-21 21:03:01.000000000 -0300
+++ linux-3.0.4/drivers/base/firmware_class.c 2011-09-21 21:03:13.000000000 -0300
@@ -523,6 +523,7 @@ static int _request_firmware(const struc
if (WARN_ON(usermodehelper_is_disabled())) {
dev_err(device, "firmware: %s will not be loaded\n", name);
+ *firmware_p = NULL;
return -EBUSY;
}
--- linux-3.0.4/drivers/usb/misc/isight_firmware.c.orig 2011-09-21 20:47:39.000000000 -0300
+++ linux-3.0.4/drivers/usb/misc/isight_firmware.c 2011-09-21 20:47:46.000000000 -0300
@@ -39,7 +39,7 @@ static int isight_firmware_load(struct u
{
struct usb_device *dev = interface_to_usbdev(intf);
int llen, len, req, ret = 0;
- const struct firmware *firmware;
+ const struct firmware *firmware = NULL;
unsigned char *buf = kmalloc(50, GFP_KERNEL);
unsigned char data[4];
const u8 *ptr;
next reply other threads:[~2011-09-22 2:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-22 2:55 Lucas C. Villa Real [this message]
2011-09-22 9:23 ` [PATCH] Initialize pointer on request_firmware Borislav Petkov
2011-09-22 17:18 ` Greg KH
2011-09-22 17:54 ` Borislav Petkov
2011-09-22 18:03 ` Greg KH
2011-09-22 18:20 ` Borislav Petkov
2011-09-22 19:05 ` Lucas C. Villa Real
2011-09-23 15:51 ` Lucas C. Villa Real
2011-09-27 20:13 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110921235515.7476c5fe.lucasvr@gmail.com \
--to=lucasvr@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox