Re: [PATCH bpf-next 09/16] bpf: Add bpf_selem_free()

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

 



On 3/6/23 12:42 AM, Martin KaFai Lau wrote:
diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c
index 8b0c9e4341eb..4fc078e8e9ca 100644
--- a/net/core/bpf_sk_storage.c
+++ b/net/core/bpf_sk_storage.c
@@ -197,7 +197,7 @@ int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk)
  		} else {
  			ret = bpf_local_storage_alloc(newsk, smap, copy_selem, GFP_ATOMIC);
  			if (ret) {
-				kfree(copy_selem);
+				bpf_selem_free(selem, smap, true);
noticed there is a bug here, should be copy_selem. will fix.

  				atomic_sub(smap->elem_size,
  					   &newsk->sk_omem_alloc);
  				bpf_map_put(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