mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
RDMA/uverbs: Fix potential leak of resources->collection in flow_resources_alloc()
The two array allocations are done unconditionally and only checked
afterwards, so if the counters allocation fails while the collection
allocation succeeds, the error path frees counters and the containing
struct but never frees resources->collection, losing the only pointer
to it.
Fixes: de7498147d ("RDMA/uverbs: Refactor flow_resources_alloc() function")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260826073146.2203-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
23d7e03a52
commit
08d4d9802d
|
|
@ -26,6 +26,7 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs)
|
|||
return resources;
|
||||
|
||||
err:
|
||||
kfree(resources->collection);
|
||||
kfree(resources->counters);
|
||||
kfree(resources);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user