@@ -23,7 +23,7 @@ struct used_bucket {
23
23
24
24
struct relocation_head {
25
25
struct hlist_node node ;
26
- struct list_head * rel_entry ;
26
+ struct list_head rel_entry ;
27
27
void * location ;
28
28
};
29
29
@@ -634,7 +634,7 @@ process_accumulated_relocations(struct module *me,
634
634
location = rel_head_iter -> location ;
635
635
list_for_each_entry_safe (rel_entry_iter ,
636
636
rel_entry_iter_tmp ,
637
- rel_head_iter -> rel_entry ,
637
+ & rel_head_iter -> rel_entry ,
638
638
head ) {
639
639
curr_type = rel_entry_iter -> type ;
640
640
reloc_handlers [curr_type ].reloc_handler (
@@ -704,16 +704,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
704
704
return - ENOMEM ;
705
705
}
706
706
707
- rel_head -> rel_entry =
708
- kmalloc (sizeof (struct list_head ), GFP_KERNEL );
709
-
710
- if (!rel_head -> rel_entry ) {
711
- kfree (entry );
712
- kfree (rel_head );
713
- return - ENOMEM ;
714
- }
715
-
716
- INIT_LIST_HEAD (rel_head -> rel_entry );
707
+ INIT_LIST_HEAD (& rel_head -> rel_entry );
717
708
rel_head -> location = location ;
718
709
INIT_HLIST_NODE (& rel_head -> node );
719
710
if (!current_head -> first ) {
@@ -722,7 +713,6 @@ static int add_relocation_to_accumulate(struct module *me, int type,
722
713
723
714
if (!bucket ) {
724
715
kfree (entry );
725
- kfree (rel_head -> rel_entry );
726
716
kfree (rel_head );
727
717
return - ENOMEM ;
728
718
}
@@ -735,7 +725,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
735
725
}
736
726
737
727
/* Add relocation to head of discovered rel_head */
738
- list_add_tail (& entry -> head , rel_head -> rel_entry );
728
+ list_add_tail (& entry -> head , & rel_head -> rel_entry );
739
729
740
730
return 0 ;
741
731
}
0 commit comments