summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 19:25:39 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 19:25:39 -0800
commit01b1c16e7f272bf7559d2499f42bc1abbde9304c (patch)
tree052f12ed57a03ab060410d2681c136d8da4c991e
parent59472fea0c1a0910ff40be463f7050c1ef2a15ef (diff)
downloadlongterm-queue-2.6.33-01b1c16e7f272bf7559d2499f42bc1abbde9304c.tar.gz
.33
-rw-r--r--queue-2.6.33/fs-partitions-validate-map_count-in-mac-partition-tables.patch66
-rw-r--r--queue-2.6.33/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch47
-rw-r--r--queue-2.6.33/series2
3 files changed, 115 insertions, 0 deletions
diff --git a/queue-2.6.33/fs-partitions-validate-map_count-in-mac-partition-tables.patch b/queue-2.6.33/fs-partitions-validate-map_count-in-mac-partition-tables.patch
new file mode 100644
index 0000000..526d913
--- /dev/null
+++ b/queue-2.6.33/fs-partitions-validate-map_count-in-mac-partition-tables.patch
@@ -0,0 +1,66 @@
+From fa7ea87a057958a8b7926c1a60a3ca6d696328ed Mon Sep 17 00:00:00 2001
+From: Timo Warns <warns@pre-sense.de>
+Date: Thu, 17 Feb 2011 22:27:40 +0100
+Subject: fs/partitions: Validate map_count in Mac partition tables
+
+From: Timo Warns <warns@pre-sense.de>
+
+commit fa7ea87a057958a8b7926c1a60a3ca6d696328ed upstream.
+
+Validate number of blocks in map and remove redundant variable.
+
+Signed-off-by: Timo Warns <warns@pre-sense.de>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/partitions/mac.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/fs/partitions/mac.c
++++ b/fs/partitions/mac.c
+@@ -29,10 +29,9 @@ static inline void mac_fix_string(char *
+
+ int mac_partition(struct parsed_partitions *state, struct block_device *bdev)
+ {
+- int slot = 1;
+ Sector sect;
+ unsigned char *data;
+- int blk, blocks_in_map;
++ int slot, blocks_in_map;
+ unsigned secsize;
+ #ifdef CONFIG_PPC_PMAC
+ int found_root = 0;
+@@ -59,10 +58,14 @@ int mac_partition(struct parsed_partitio
+ put_dev_sector(sect);
+ return 0; /* not a MacOS disk */
+ }
+- printk(" [mac]");
+ blocks_in_map = be32_to_cpu(part->map_count);
+- for (blk = 1; blk <= blocks_in_map; ++blk) {
+- int pos = blk * secsize;
++ if (blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS) {
++ put_dev_sector(sect);
++ return 0;
++ }
++ printk(" [mac]");
++ for (slot = 1; slot <= blocks_in_map; ++slot) {
++ int pos = slot * secsize;
+ put_dev_sector(sect);
+ data = read_dev_sector(bdev, pos/512, &sect);
+ if (!data)
+@@ -113,13 +116,11 @@ int mac_partition(struct parsed_partitio
+ }
+
+ if (goodness > found_root_goodness) {
+- found_root = blk;
++ found_root = slot;
+ found_root_goodness = goodness;
+ }
+ }
+ #endif /* CONFIG_PPC_PMAC */
+-
+- ++slot;
+ }
+ #ifdef CONFIG_PPC_PMAC
+ if (found_root_goodness)
diff --git a/queue-2.6.33/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch b/queue-2.6.33/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch
new file mode 100644
index 0000000..1065cb5
--- /dev/null
+++ b/queue-2.6.33/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch
@@ -0,0 +1,47 @@
+From 2e725a065b0153f0c449318da1923a120477633d Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <stf_xl@pop3.wp.pl>
+Date: Sat, 12 Feb 2011 21:06:51 +0100
+Subject: PM / Hibernate: Return error code when alloc_image_page() fails
+
+From: Stanislaw Gruszka <stf_xl@pop3.wp.pl>
+
+commit 2e725a065b0153f0c449318da1923a120477633d upstream.
+
+Currently we return 0 in swsusp_alloc() when alloc_image_page() fails.
+Fix that. Also remove unneeded "error" variable since the only
+useful value of error is -ENOMEM.
+
+[rjw: Fixed up the changelog and changed subject.]
+
+Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
+Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/power/snapshot.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/kernel/power/snapshot.c
++++ b/kernel/power/snapshot.c
+@@ -1466,11 +1466,8 @@ static int
+ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
+ unsigned int nr_pages, unsigned int nr_highmem)
+ {
+- int error = 0;
+-
+ if (nr_highmem > 0) {
+- error = get_highmem_buffer(PG_ANY);
+- if (error)
++ if (get_highmem_buffer(PG_ANY))
+ goto err_out;
+ if (nr_highmem > alloc_highmem) {
+ nr_highmem -= alloc_highmem;
+@@ -1493,7 +1490,7 @@ swsusp_alloc(struct memory_bitmap *orig_
+
+ err_out:
+ swsusp_free();
+- return error;
++ return -ENOMEM;
+ }
+
+ asmlinkage int swsusp_save(void)
diff --git a/queue-2.6.33/series b/queue-2.6.33/series
index 4825518..3252334 100644
--- a/queue-2.6.33/series
+++ b/queue-2.6.33/series
@@ -357,3 +357,5 @@ tcp-increase-tcp_maxseg-socket-option-minimum.patch
tcp-make-tcp_maxseg-minimum-more-correct.patch
nfsd-correctly-handle-return-value-from-nfsd_map_name_to_.patch
s390-remove-task_show_regs.patch
+pm-hibernate-return-error-code-when-alloc_image_page-fails.patch
+fs-partitions-validate-map_count-in-mac-partition-tables.patch