@@ -1841,7 +1841,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
1841
1841
1842
1842
ret = get_user (ch , ubuf ++ );
1843
1843
if (ret )
1844
- goto out ;
1844
+ return ret ;
1845
1845
1846
1846
read ++ ;
1847
1847
cnt -- ;
@@ -1855,7 +1855,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
1855
1855
while (cnt && isspace (ch )) {
1856
1856
ret = get_user (ch , ubuf ++ );
1857
1857
if (ret )
1858
- goto out ;
1858
+ return ret ;
1859
1859
read ++ ;
1860
1860
cnt -- ;
1861
1861
}
@@ -1865,22 +1865,20 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
1865
1865
/* only spaces were written */
1866
1866
if (isspace (ch ) || !ch ) {
1867
1867
* ppos += read ;
1868
- ret = read ;
1869
- goto out ;
1868
+ return read ;
1870
1869
}
1871
1870
}
1872
1871
1873
1872
/* read the non-space input */
1874
1873
while (cnt && !isspace (ch ) && ch ) {
1875
1874
if (parser -> idx < parser -> size - 1 )
1876
1875
parser -> buffer [parser -> idx ++ ] = ch ;
1877
- else {
1878
- ret = - EINVAL ;
1879
- goto out ;
1880
- }
1876
+ else
1877
+ return - EINVAL ;
1878
+
1881
1879
ret = get_user (ch , ubuf ++ );
1882
1880
if (ret )
1883
- goto out ;
1881
+ return ret ;
1884
1882
read ++ ;
1885
1883
cnt -- ;
1886
1884
}
@@ -1895,15 +1893,11 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
1895
1893
/* Make sure the parsed string always terminates with '\0'. */
1896
1894
parser -> buffer [parser -> idx ] = 0 ;
1897
1895
} else {
1898
- ret = - EINVAL ;
1899
- goto out ;
1896
+ return - EINVAL ;
1900
1897
}
1901
1898
1902
1899
* ppos += read ;
1903
- ret = read ;
1904
-
1905
- out :
1906
- return ret ;
1900
+ return read ;
1907
1901
}
1908
1902
1909
1903
/* TODO add a seq_buf_to_buffer() */
@@ -2405,10 +2399,10 @@ int __init register_tracer(struct tracer *type)
2405
2399
mutex_unlock (& trace_types_lock );
2406
2400
2407
2401
if (ret || !default_bootup_tracer )
2408
- goto out_unlock ;
2402
+ return ret ;
2409
2403
2410
2404
if (strncmp (default_bootup_tracer , type -> name , MAX_TRACER_SIZE ))
2411
- goto out_unlock ;
2405
+ return 0 ;
2412
2406
2413
2407
printk (KERN_INFO "Starting tracer '%s'\n" , type -> name );
2414
2408
/* Do we want this tracer to start on bootup? */
@@ -2420,8 +2414,7 @@ int __init register_tracer(struct tracer *type)
2420
2414
/* disable other selftests, since this will break it. */
2421
2415
disable_tracing_selftest ("running a tracer" );
2422
2416
2423
- out_unlock :
2424
- return ret ;
2417
+ return 0 ;
2425
2418
}
2426
2419
2427
2420
static void tracing_reset_cpu (struct array_buffer * buf , int cpu )
@@ -8963,12 +8956,12 @@ ftrace_trace_snapshot_callback(struct trace_array *tr, struct ftrace_hash *hash,
8963
8956
out_reg :
8964
8957
ret = tracing_arm_snapshot (tr );
8965
8958
if (ret < 0 )
8966
- goto out ;
8959
+ return ret ;
8967
8960
8968
8961
ret = register_ftrace_function_probe (glob , tr , ops , count );
8969
8962
if (ret < 0 )
8970
8963
tracing_disarm_snapshot (tr );
8971
- out :
8964
+
8972
8965
return ret < 0 ? ret : 0 ;
8973
8966
}
8974
8967
@@ -11070,7 +11063,7 @@ __init static int tracer_alloc_buffers(void)
11070
11063
BUILD_BUG_ON (TRACE_ITER_LAST_BIT > TRACE_FLAGS_MAX_SIZE );
11071
11064
11072
11065
if (!alloc_cpumask_var (& tracing_buffer_mask , GFP_KERNEL ))
11073
- goto out ;
11066
+ return - ENOMEM ;
11074
11067
11075
11068
if (!alloc_cpumask_var (& global_trace .tracing_cpumask , GFP_KERNEL ))
11076
11069
goto out_free_buffer_mask ;
@@ -11188,7 +11181,6 @@ __init static int tracer_alloc_buffers(void)
11188
11181
free_cpumask_var (global_trace .tracing_cpumask );
11189
11182
out_free_buffer_mask :
11190
11183
free_cpumask_var (tracing_buffer_mask );
11191
- out :
11192
11184
return ret ;
11193
11185
}
11194
11186
0 commit comments