Re: [PATCH bpf-next v1 2/5] bpf: Support getting referenced kptr from struct_ops argument

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

 



On 2/14/25 8:45 AM, Amery Hung wrote:
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 9de6acddd479..fd3470fbd144 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6677,6 +6677,7 @@ bool btf_ctx_access(int off, int size, enum bpf_access_type type,
  			info->reg_type = ctx_arg_info->reg_type;
  			info->btf = ctx_arg_info->btf ? : btf_vmlinux;
  			info->btf_id = ctx_arg_info->btf_id;
+			info->ref_obj_id = ctx_arg_info->refcounted ? ctx_arg_info->ref_obj_id : 0;

A small nit. No need to check ctx_arg_info->refcounted. If refcounted is false, ref_obj_id should have been 0.

			info->ref_obj_id = ctx_arg_info->ref_obj_id;


Acked-by: Martin KaFai Lau <martin.lau@xxxxxxxxxx>




[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