aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/pm.c')
-rw-r--r--arch/arm/mach-pxa/pm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index ec1bbf333a3a..329df2152dcd 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -42,7 +42,7 @@ int pxa_pm_enter(suspend_state_t state)
42 if (state != PM_SUSPEND_STANDBY) { 42 if (state != PM_SUSPEND_STANDBY) {
43 pxa_cpu_pm_fns->save(sleep_save); 43 pxa_cpu_pm_fns->save(sleep_save);
44 /* before sleeping, calculate and save a checksum */ 44 /* before sleeping, calculate and save a checksum */
45 for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++) 45 for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
46 sleep_save_checksum += sleep_save[i]; 46 sleep_save_checksum += sleep_save[i];
47 } 47 }
48 48
@@ -55,7 +55,7 @@ int pxa_pm_enter(suspend_state_t state)
55 55
56 if (state != PM_SUSPEND_STANDBY) { 56 if (state != PM_SUSPEND_STANDBY) {
57 /* after sleeping, validate the checksum */ 57 /* after sleeping, validate the checksum */
58 for (i = 0; i < pxa_cpu_pm_fns->save_size - 1; i++) 58 for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
59 checksum += sleep_save[i]; 59 checksum += sleep_save[i];
60 60
61 /* if invalid, display message and wait for a hardware reset */ 61 /* if invalid, display message and wait for a hardware reset */
@@ -101,7 +101,8 @@ static int __init pxa_pm_init(void)
101 return -EINVAL; 101 return -EINVAL;
102 } 102 }
103 103
104 sleep_save = kmalloc(pxa_cpu_pm_fns->save_size, GFP_KERNEL); 104 sleep_save = kmalloc(pxa_cpu_pm_fns->save_count * sizeof(unsigned long),
105 GFP_KERNEL);
105 if (!sleep_save) { 106 if (!sleep_save) {
106 printk(KERN_ERR "failed to alloc memory for pm save\n"); 107 printk(KERN_ERR "failed to alloc memory for pm save\n");
107 return -ENOMEM; 108 return -ENOMEM;