From: Greg KH <greg@kroah.com>
To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB and Driver Core patches for 2.6.10
Date: Fri, 7 Jan 2005 21:47:37 -0800 [thread overview]
Message-ID: <1105163257205@kroah.com> (raw)
In-Reply-To: <1105163257891@kroah.com>
ChangeSet 1.1938.439.47, 2005/01/06 16:39:32-08:00, jbarnes@engr.sgi.com
[PATCH] fix oops when reading resourceN files in sysfs
On Thursday, January 6, 2005 12:25 pm, Jesse Barnes wrote:
> [Sorry about the bogus reply, I don't have the original message.]
>
> That shouldn't happen. Maybe you were running an old version of the tree
> or an old version of my sysfs mmap patch? When I do a 'bk pull' of
> gregkh's latest usb tree into a recent Linus tree, I get an -EINVAL, not an
> oops. An earlier version of my patch had this bug though, so maybe that's
> what you're seeing?
Ugg. How about this?
Zero out newly allocated bin_attributes for legacy I/O, memory and resource
files since we won't fill in all of the file operation methods. This will
allow the checks in bin.c for the existence of a method to work properly
instead of checking garbage memory.
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/pci/pci-sysfs.c | 1 +
drivers/pci/probe.c | 1 +
2 files changed, 2 insertions(+)
diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
--- a/drivers/pci/pci-sysfs.c 2005-01-07 15:38:33 -08:00
+++ b/drivers/pci/pci-sysfs.c 2005-01-07 15:38:33 -08:00
@@ -295,6 +295,7 @@
res_attr = kmalloc(sizeof(*res_attr) + 10, GFP_ATOMIC);
if (res_attr) {
+ memset(res_attr, 0, sizeof(*res_attr) + 10);
pdev->res_attr[i] = res_attr;
/* Allocated above after the res_attr struct */
res_attr->attr.name = (char *)(res_attr + 1);
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c 2005-01-07 15:38:33 -08:00
+++ b/drivers/pci/probe.c 2005-01-07 15:38:33 -08:00
@@ -41,6 +41,7 @@
b->legacy_io = kmalloc(sizeof(struct bin_attribute) * 2,
GFP_ATOMIC);
if (b->legacy_io) {
+ memset(b->legacy_io, 0, sizeof(struct bin_attribute) * 2);
b->legacy_io->attr.name = "legacy_io";
b->legacy_io->size = 0xffff;
b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
next prev parent reply other threads:[~2005-01-08 9:10 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-08 5:46 [BK PATCH] USB and Driver Core patches for 2.6.10 Greg KH
2005-01-08 5:47 ` [PATCH] " Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH [this message]
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 5:47 ` Greg KH
2005-01-08 12:08 ` Christoph Hellwig
2005-01-08 22:42 ` Greg KH
2005-01-08 23:33 ` Alessandro Suardi
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=1105163257205@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).