Re: [PATCH] bpftool: Try to read btf as raw data if elf read fails

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

 



On Fri, Oct 18, 2019 at 08:04:44PM +0000, Yonghong Song wrote:

SNIP

> >> +	FILE *f;
> >> +
> >> +	if (stat(file, &st))
> >> +		return btf;
> >> +
> >> +	f = fopen(file, "rb");
> >> +	if (!f)
> >> +		return btf;
> >> +
> >> +	buf = malloc(st.st_size);
> >> +	if (!buf)
> >> +		goto err;
> >> +
> >> +	if ((size_t) st.st_size != fread(buf, 1, st.st_size, f))
> >> +		goto err;
> >> +
> >> +	btf = btf__new(buf, st.st_size);
> >> +
> >> +err:
> 
> Non error case can also reach here. Let us change
> label to a different name, e.g., "done"?

ok, will change

thanks,
jirka





[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