Skip to content

Commit

Permalink
sysfs: Initialised pci bus legacy_mem field before use
Browse files Browse the repository at this point in the history
PPC64 is failing to boot the latest mmotm due to an uninitialised pointer in
pci_create_legacy_files(). The surprise is that machines boot at all and it
would appear to affect current mainline as well.  This patch fixes the problem.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mel Gorman authored and Greg Kroah-Hartman committed Mar 19, 2010
1 parent e1955ca commit 6757eca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pci-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ void pci_create_legacy_files(struct pci_bus *b)
goto legacy_io_err;

/* Allocated above after the legacy_io struct */
sysfs_bin_attr_init(b->legacy_mem);
b->legacy_mem = b->legacy_io + 1;
sysfs_bin_attr_init(b->legacy_mem);
b->legacy_mem->attr.name = "legacy_mem";
b->legacy_mem->size = 1024*1024;
b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR;
Expand Down

0 comments on commit 6757eca

Please sign in to comment.