Re: [PATCH bpf-next v1 1/8] libbpf: allow version suffixes (___smth) for struct_ops types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2024-02-27 at 13:47 -0800, Kui-Feng Lee wrote:
[...]

> > @@ -997,7 +1004,8 @@ find_struct_ops_kern_types(struct bpf_object *obj, const char *tname,
> >   	if (i == btf_vlen(kern_vtype)) {
> >   		pr_warn("struct_ops init_kern: struct %s data is not found in struct %s%s\n",
> >   			tname, STRUCT_OPS_VALUE_PREFIX, tname);
> > -		return -EINVAL;
> > +		err = -EINVAL;
> > +		goto err_out;
> >   	}
> >   
> >   	*type = kern_type;
> > @@ -1007,6 +1015,10 @@ find_struct_ops_kern_types(struct bpf_object *obj, const char *tname,
> >   	*data_member = kern_data_member;
> 
> Where is going to free tname when it successes?

My bad, thank you for spotting this.

> >   
> >   	return 0;
> > +
> > +err_out:
> > +	free(tname);
> > +	return err;
> >   }
> >   
> >   static bool bpf_map__is_struct_ops(const struct bpf_map *map)






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux