summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-11-30 16:10:40 -0800
committerJakub Kicinski <kuba@kernel.org>2023-11-30 16:11:19 -0800
commit975f2d73a99f35b57ffa2ad7bff8562225cdcfcb (patch)
treed6c9ce96cfd889281e003a310c79d5a12a3cf924 /kernel
parentf9893fdac319bb2817e5e7818870264d7fb2eb02 (diff)
parent6172a5180fcc65170bfa2d49e55427567860f2a7 (diff)
downloadlinux-stable-975f2d73a99f35b57ffa2ad7bff8562225cdcfcb.tar.gz
linux-stable-975f2d73a99f35b57ffa2ad7bff8562225cdcfcb.tar.bz2
linux-stable-975f2d73a99f35b57ffa2ad7bff8562225cdcfcb.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/memalloc.c2
-rw-r--r--kernel/locking/lockdep.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c
index 63b909d277d4..6a51cfe4c2d6 100644
--- a/kernel/bpf/memalloc.c
+++ b/kernel/bpf/memalloc.c
@@ -978,6 +978,8 @@ void notrace *bpf_mem_cache_alloc_flags(struct bpf_mem_alloc *ma, gfp_t flags)
memcg = get_memcg(c);
old_memcg = set_active_memcg(memcg);
ret = __alloc(c, NUMA_NO_NODE, GFP_KERNEL | __GFP_NOWARN | __GFP_ACCOUNT);
+ if (ret)
+ *(struct bpf_mem_cache **)ret = c;
set_active_memcg(old_memcg);
mem_cgroup_put(memcg);
}
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e85b5ad3e206..151bd3de5936 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3497,7 +3497,8 @@ static int alloc_chain_hlocks(int req)
size = chain_block_size(curr);
if (likely(size >= req)) {
del_chain_block(0, size, chain_block_next(curr));
- add_chain_block(curr + req, size - req);
+ if (size > req)
+ add_chain_block(curr + req, size - req);
return curr;
}
}