@@ -386,12 +386,12 @@ static const struct btf_type *find_btf_func_proto(const char *funcname)
386
386
387
387
/* Get BTF_KIND_FUNC type */
388
388
t = btf_type_by_id (btf , id );
389
- if (!btf_type_is_func (t ))
389
+ if (!t || ! btf_type_is_func (t ))
390
390
return ERR_PTR (- ENOENT );
391
391
392
392
/* The type of BTF_KIND_FUNC is BTF_KIND_FUNC_PROTO */
393
393
t = btf_type_by_id (btf , t -> type );
394
- if (!btf_type_is_func_proto (t ))
394
+ if (!t || ! btf_type_is_func_proto (t ))
395
395
return ERR_PTR (- ENOENT );
396
396
397
397
return t ;
@@ -443,7 +443,7 @@ static int parse_btf_arg(const char *varname, struct fetch_insn *code,
443
443
if (!ctx -> params ) {
444
444
params = find_btf_func_param (ctx -> funcname , & ctx -> nr_params ,
445
445
ctx -> flags & TPARG_FL_TPOINT );
446
- if (IS_ERR (params )) {
446
+ if (IS_ERR_OR_NULL (params )) {
447
447
trace_probe_log_err (ctx -> offset , NO_BTF_ENTRY );
448
448
return PTR_ERR (params );
449
449
}
@@ -1273,7 +1273,7 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
1273
1273
1274
1274
params = find_btf_func_param (ctx -> funcname , & nr_params ,
1275
1275
ctx -> flags & TPARG_FL_TPOINT );
1276
- if (IS_ERR (params )) {
1276
+ if (IS_ERR_OR_NULL (params )) {
1277
1277
if (args_idx != -1 ) {
1278
1278
/* $arg* requires BTF info */
1279
1279
trace_probe_log_err (0 , NOSUP_BTFARG );
0 commit comments