bpf: put file handler if no storage found
Subsystems (3)
PATCH 1/1 bpf: put file handler if no storage found
Put file f if inode_storage_ptr() returns NULL.
Fixes 8ea636848aca ("bpf: Implement bpf_local_storage for inodes")
Acked-by KP Singh <[email protected]>
Signed-off-by Pan Bian <[email protected]>
--- kernel/bpf/bpf_inode_storage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/bpf/bpf_inode_storage.c +5 -1
@@ -125,8 +125,12 @@ static int bpf_fd_inode_storage_update_elem(struct bpf_map *map, void *key, fd = *(int *)key; f =fget_raw (fd); -if (!f || !inode_storage_ptr (f->f_inode)) +if (!f) +return -EBADF ; +if (!inode_storage_ptr (f->f_inode)) { +fput (f);return -EBADF ; + } sdata = bpf_local_storage_update(f->f_inode, (struct bpf_local_storage_map *)map,
Signature · 1 line
2.17.1
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 8 lines · On Wed, 20 Jan 2021 18:08:56 -0800 you wrote:
Put file f if
inode_storage_ptr()returns NULL.Fixes 8ea636848aca ("bpf: Implement bpf_local_storage for inodes")Acked-by KP Singh <[email protected]>Signed-off-by Pan Bian <[email protected]>--- kernel/bpf/bpf_inode_storage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Here is the summary with links:
- bpf: put file handler if no storage found
https://git.kernel.org/bpf/bpf/c/524db191d2f5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html