File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -2921,7 +2921,7 @@ int __ksm_enter(struct mm_struct *mm)
29212921
29222922void __ksm_exit (struct mm_struct * mm )
29232923{
2924- struct ksm_mm_slot * mm_slot ;
2924+ struct ksm_mm_slot * mm_slot = NULL ;
29252925 struct mm_slot * slot ;
29262926 int easy_to_free = 0 ;
29272927
@@ -2936,19 +2936,20 @@ void __ksm_exit(struct mm_struct *mm)
29362936
29372937 spin_lock (& ksm_mmlist_lock );
29382938 slot = mm_slot_lookup (mm_slots_hash , mm );
2939- if (slot ) {
2940- mm_slot = mm_slot_entry ( slot , struct ksm_mm_slot , slot ) ;
2941- if ( ksm_scan . mm_slot != mm_slot ) {
2942- if (! mm_slot -> rmap_list ) {
2943- hash_del ( & slot -> hash ) ;
2944- list_del ( & slot -> mm_node );
2945- easy_to_free = 1 ;
2946- } else {
2947- list_move ( & slot -> mm_node ,
2948- & ksm_scan . mm_slot -> slot . mm_node );
2949- }
2950- }
2939+ if (! slot )
2940+ goto unlock ;
2941+ mm_slot = mm_slot_entry ( slot , struct ksm_mm_slot , slot );
2942+ if (ksm_scan . mm_slot == mm_slot )
2943+ goto unlock ;
2944+ if (! mm_slot -> rmap_list ) {
2945+ hash_del ( & slot -> hash ) ;
2946+ list_del ( & slot -> mm_node );
2947+ easy_to_free = 1 ;
2948+ } else {
2949+ list_move ( & slot -> mm_node ,
2950+ & ksm_scan . mm_slot -> slot . mm_node );
29512951 }
2952+ unlock :
29522953 spin_unlock (& ksm_mmlist_lock );
29532954
29542955 if (easy_to_free ) {
You can’t perform that action at this time.
0 commit comments