Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[sfrench/cifs-2.6.git] / fs / binfmt_elf.c
index e4f7ef8294ac459365e75e73c59891417be15e23..83732fef510d284032a16fb2f7b95c4f94ad1dd3 100644 (file)
@@ -1710,7 +1710,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
                                 long signr, size_t *total)
 {
        unsigned int i;
-       unsigned int regset_size = view->regsets[0].n * view->regsets[0].size;
+       unsigned int regset0_size = regset_size(t->task, &view->regsets[0]);
 
        /*
         * NT_PRSTATUS is the one special case, because the regset data
@@ -1719,11 +1719,11 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
         * We assume that regset 0 is NT_PRSTATUS.
         */
        fill_prstatus(&t->prstatus, t->task, signr);
-       (void) view->regsets[0].get(t->task, &view->regsets[0], 0, regset_size,
+       (void) view->regsets[0].get(t->task, &view->regsets[0], 0, regset0_size,
                                    &t->prstatus.pr_reg, NULL);
 
        fill_note(&t->notes[0], "CORE", NT_PRSTATUS,
-                 PRSTATUS_SIZE(t->prstatus, regset_size), &t->prstatus);
+                 PRSTATUS_SIZE(t->prstatus, regset0_size), &t->prstatus);
        *total += notesize(&t->notes[0]);
 
        do_thread_regset_writeback(t->task, &view->regsets[0]);
@@ -1739,7 +1739,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
                if (regset->core_note_type && regset->get &&
                    (!regset->active || regset->active(t->task, regset))) {
                        int ret;
-                       size_t size = regset->n * regset->size;
+                       size_t size = regset_size(t->task, regset);
                        void *data = kmalloc(size, GFP_KERNEL);
                        if (unlikely(!data))
                                return 0;
@@ -1754,7 +1754,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
                                                  size, data);
                                else {
                                        SET_PR_FPVALID(&t->prstatus,
-                                                       1, regset_size);
+                                                       1, regset0_size);
                                        fill_note(&t->notes[i], "CORE",
                                                  NT_PRFPREG, size, data);
                                }