@@ -552,16 +552,14 @@ static int register_trigger(char *glob,
552
552
lockdep_assert_held (& event_mutex );
553
553
554
554
list_for_each_entry (test , & file -> triggers , list ) {
555
- if (test -> cmd_ops -> trigger_type == data -> cmd_ops -> trigger_type ) {
556
- ret = - EEXIST ;
557
- goto out ;
558
- }
555
+ if (test -> cmd_ops -> trigger_type == data -> cmd_ops -> trigger_type )
556
+ return - EEXIST ;
559
557
}
560
558
561
559
if (data -> ops -> init ) {
562
560
ret = data -> ops -> init (data );
563
561
if (ret < 0 )
564
- goto out ;
562
+ return ret ;
565
563
}
566
564
567
565
list_add_rcu (& data -> list , & file -> triggers );
@@ -572,7 +570,6 @@ static int register_trigger(char *glob,
572
570
list_del_rcu (& data -> list );
573
571
update_cond_flag (file );
574
572
}
575
- out :
576
573
return ret ;
577
574
}
578
575
@@ -770,7 +767,7 @@ int event_trigger_separate_filter(char *param_and_filter, char **param,
770
767
if (!param_and_filter ) {
771
768
if (param_required )
772
769
ret = - EINVAL ;
773
- goto out ;
770
+ return ret ;
774
771
}
775
772
776
773
/*
@@ -781,7 +778,7 @@ int event_trigger_separate_filter(char *param_and_filter, char **param,
781
778
*/
782
779
if (!param_required && param_and_filter && !isdigit (param_and_filter [0 ])) {
783
780
* filter = param_and_filter ;
784
- goto out ;
781
+ return ret ;
785
782
}
786
783
787
784
/*
@@ -799,7 +796,6 @@ int event_trigger_separate_filter(char *param_and_filter, char **param,
799
796
if (!* * filter )
800
797
* filter = NULL ;
801
798
}
802
- out :
803
799
return ret ;
804
800
}
805
801
@@ -991,13 +987,12 @@ event_trigger_parse(struct event_command *cmd_ops,
991
987
ret = - ENOMEM ;
992
988
trigger_data = trigger_data_alloc (cmd_ops , cmd , param , file );
993
989
if (!trigger_data )
994
- goto out ;
990
+ return ret ;
995
991
996
992
if (remove ) {
997
993
event_trigger_unregister (cmd_ops , file , glob + 1 , trigger_data );
998
994
trigger_data_free (trigger_data );
999
- ret = 0 ;
1000
- goto out ;
995
+ return 0 ;
1001
996
}
1002
997
1003
998
ret = event_trigger_parse_num (param , trigger_data );
@@ -1017,13 +1012,12 @@ event_trigger_parse(struct event_command *cmd_ops,
1017
1012
1018
1013
/* Down the counter of trigger_data or free it if not used anymore */
1019
1014
event_trigger_free (trigger_data );
1020
- out :
1021
1015
return ret ;
1022
1016
1023
1017
out_free :
1024
1018
event_trigger_reset_filter (cmd_ops , trigger_data );
1025
1019
trigger_data_free (trigger_data );
1026
- goto out ;
1020
+ return ret ;
1027
1021
}
1028
1022
1029
1023
/**
@@ -1057,10 +1051,10 @@ int set_trigger_filter(char *filter_str,
1057
1051
s = strsep (& filter_str , " \t" );
1058
1052
1059
1053
if (!strlen (s ) || strcmp (s , "if" ) != 0 )
1060
- goto out ;
1054
+ return ret ;
1061
1055
1062
1056
if (!filter_str )
1063
- goto out ;
1057
+ return ret ;
1064
1058
1065
1059
/* The filter is for the 'trigger' event, not the triggered event */
1066
1060
ret = create_event_filter (file -> tr , file -> event_call ,
@@ -1104,7 +1098,6 @@ int set_trigger_filter(char *filter_str,
1104
1098
ret = - ENOMEM ;
1105
1099
}
1106
1100
}
1107
- out :
1108
1101
return ret ;
1109
1102
}
1110
1103
@@ -1772,7 +1765,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
1772
1765
ret = - EINVAL ;
1773
1766
event_enable_file = find_event_file (tr , system , event );
1774
1767
if (!event_enable_file )
1775
- goto out ;
1768
+ return ret ;
1776
1769
1777
1770
#ifdef CONFIG_HIST_TRIGGERS
1778
1771
hist = ((strcmp (cmd , ENABLE_HIST_STR ) == 0 ) ||
@@ -1787,7 +1780,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
1787
1780
1788
1781
enable_data = kzalloc (sizeof (* enable_data ), GFP_KERNEL );
1789
1782
if (!enable_data )
1790
- goto out ;
1783
+ return ret ;
1791
1784
1792
1785
enable_data -> hist = hist ;
1793
1786
enable_data -> enable = enable ;
@@ -1796,15 +1789,15 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
1796
1789
trigger_data = trigger_data_alloc (cmd_ops , cmd , param , enable_data );
1797
1790
if (!trigger_data ) {
1798
1791
kfree (enable_data );
1799
- goto out ;
1792
+ return ret ;
1800
1793
}
1801
1794
1802
1795
if (remove ) {
1803
1796
event_trigger_unregister (cmd_ops , file , glob + 1 , trigger_data );
1804
1797
kfree (trigger_data );
1805
1798
kfree (enable_data );
1806
1799
ret = 0 ;
1807
- goto out ;
1800
+ return ret ;
1808
1801
}
1809
1802
1810
1803
/* Up the trigger_data count to make sure nothing frees it on failure */
@@ -1834,7 +1827,6 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
1834
1827
goto out_disable ;
1835
1828
1836
1829
event_trigger_free (trigger_data );
1837
- out :
1838
1830
return ret ;
1839
1831
out_disable :
1840
1832
trace_event_enable_disable (event_enable_file , 0 , 1 );
@@ -1845,7 +1837,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
1845
1837
event_trigger_free (trigger_data );
1846
1838
kfree (enable_data );
1847
1839
1848
- goto out ;
1840
+ return ret ;
1849
1841
}
1850
1842
1851
1843
int event_enable_register_trigger (char * glob ,
@@ -1865,15 +1857,14 @@ int event_enable_register_trigger(char *glob,
1865
1857
(test -> cmd_ops -> trigger_type ==
1866
1858
data -> cmd_ops -> trigger_type ) &&
1867
1859
(test_enable_data -> file == enable_data -> file )) {
1868
- ret = - EEXIST ;
1869
- goto out ;
1860
+ return - EEXIST ;
1870
1861
}
1871
1862
}
1872
1863
1873
1864
if (data -> ops -> init ) {
1874
1865
ret = data -> ops -> init (data );
1875
1866
if (ret < 0 )
1876
- goto out ;
1867
+ return ret ;
1877
1868
}
1878
1869
1879
1870
list_add_rcu (& data -> list , & file -> triggers );
@@ -1884,7 +1875,6 @@ int event_enable_register_trigger(char *glob,
1884
1875
list_del_rcu (& data -> list );
1885
1876
update_cond_flag (file );
1886
1877
}
1887
- out :
1888
1878
return ret ;
1889
1879
}
1890
1880
0 commit comments