@@ -1453,7 +1453,7 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
1453
1453
/* Here is the structure in which status of each thread is captured. */
1454
1454
struct elf_thread_status
1455
1455
{
1456
- struct list_head list ;
1456
+ struct elf_thread_status * next ;
1457
1457
struct elf_prstatus_fdpic prstatus ; /* NT_PRSTATUS */
1458
1458
elf_fpregset_t fpu ; /* NT_PRFPREG */
1459
1459
struct task_struct * thread ;
@@ -1578,8 +1578,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
1578
1578
struct memelfnote * notes = NULL ;
1579
1579
struct elf_prstatus_fdpic * prstatus = NULL ; /* NT_PRSTATUS */
1580
1580
struct elf_prpsinfo * psinfo = NULL ; /* NT_PRPSINFO */
1581
- LIST_HEAD (thread_list );
1582
- struct list_head * t ;
1581
+ struct elf_thread_status * thread_list = NULL ;
1583
1582
elf_fpregset_t * fpu = NULL ;
1584
1583
int thread_status_size = 0 ;
1585
1584
elf_addr_t * auxv ;
@@ -1627,15 +1626,12 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
1627
1626
goto end_coredump ;
1628
1627
1629
1628
tmp -> thread = ct -> task ;
1630
- list_add (& tmp -> list , & thread_list );
1629
+ tmp -> next = thread_list ;
1630
+ thread_list = tmp ;
1631
1631
}
1632
1632
1633
- list_for_each (t , & thread_list ) {
1634
- struct elf_thread_status * tmp ;
1635
- int sz ;
1636
-
1637
- tmp = list_entry (t , struct elf_thread_status , list );
1638
- sz = elf_dump_thread_status (cprm -> siginfo -> si_signo , tmp );
1633
+ for (tmp = thread_list ; tmp ; tmp = tmp -> next ) {
1634
+ int sz = elf_dump_thread_status (cprm -> siginfo -> si_signo , tmp );
1639
1635
thread_status_size += sz ;
1640
1636
}
1641
1637
@@ -1760,10 +1756,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
1760
1756
goto end_coredump ;
1761
1757
1762
1758
/* write out the thread status notes section */
1763
- list_for_each (t , & thread_list ) {
1764
- struct elf_thread_status * tmp =
1765
- list_entry (t , struct elf_thread_status , list );
1766
-
1759
+ for (tmp = thread_list ; tmp ; tmp = tmp -> next ) {
1767
1760
for (i = 0 ; i < tmp -> num_notes ; i ++ )
1768
1761
if (!writenote (& tmp -> notes [i ], cprm ))
1769
1762
goto end_coredump ;
@@ -1791,10 +1784,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
1791
1784
}
1792
1785
1793
1786
end_coredump :
1794
- while (! list_empty ( & thread_list ) ) {
1795
- struct list_head * tmp = thread_list . next ;
1796
- list_del ( tmp ) ;
1797
- kfree (list_entry ( tmp , struct elf_thread_status , list ) );
1787
+ while (thread_list ) {
1788
+ tmp = thread_list ;
1789
+ thread_list = thread_list -> next ;
1790
+ kfree (tmp );
1798
1791
}
1799
1792
kfree (phdr4note );
1800
1793
kfree (elf );
0 commit comments